Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thewinger/0c34ed6143bad14e767eef827b9d7554 to your computer and use it in GitHub Desktop.
Save thewinger/0c34ed6143bad14e767eef827b9d7554 to your computer and use it in GitHub Desktop.
[VirtualBox] Run Windows10 Headlessly on Linux

https://redplus.me/post/set-up-headless-windows-10-virtual-machine-on-remote-linux-server/ https://www.ostechnix.com/install-oracle-virtualbox-ubuntu-16-04-headless-server/ https://www.howtoforge.com/tutorial/running-virtual-machines-with-virtualbox-5.1-on-a-headless-ubuntu-16.04-lts-server/

Installation

$ sudo nano /etc/apt/sources.list
      deb http://download.virtualbox.org/virtualbox/debian stretch contrib
$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install linux-headers-$(uname -r) build-essential virtualbox-5.1 dkms
$ sudo systemctl status vboxdrv

Power management:

$ VBoxHeadless --startvm "Windows"
$ VBoxManage controlvm "Windows" poweroff
$ VBoxManage controlvm "Windows" reset
$ VBoxManage controlvm "Windows" pause

Create and config virtual machine:

VBoxManage createvm --name "Windows" --ostype Windows10_64 --register
VBoxManage modifyvm "Windows" --memory 3072 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 enp11s0
VBoxManage modifyvm "Windows" --cpus 2

VBoxManage createhd --filename "/root/VirtualBox VMs/Windows/Windows.vdi" --size 20000

VBoxManage storagectl "Windows" --name "IDE Controller" --add ide --controller PIIX4
VBoxManage storageattach "Windows" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium "/root/VirtualBox VMs/Windows/Windows.vdi"
VBoxManage storageattach "Windows" --storagectl "IDE Controller" --port 0 --device 1 --type dvddrive --medium "/root/VirtualBox VMs/Windows10_1803.iso"

VBoxManage modifyvm "Windows" --vrde on
VBoxManage modifyvm "Windows" --vrdeport 2233
VBoxManage modifyvm "Windows" --longmode on

Delete virtual machine from disk: VBoxManage unregistervm "Windows" --delete

DVD ISO: https://superuser.com/questions/741734/virtualbox-how-can-i-add-mount-a-iso-image-file-from-command-line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment