Install Windows 7 Guest on VirtualBox Debian Host (Command-Line)

Posted on July 24, 2019 at 3:23 pm

To install Windows 7 guest on a VirtualBox Debian host type:

VBoxManage createhd --filename Win7-64bit-VM1.vdi --size 32768
VBoxManage createvm --name Win7-64bit-VM1 --ostype Windows7_64 --register
VBoxManage storagectl Win7-64bit-VM1 --name "SATA Controller" --add sata --controller IntelAHCI
VBoxManage storageattach Win7-64bit-VM1 --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium Win7-64bit-VM1.vdi
VBoxManage storagectl Win7-64bit-VM1 --name "IDE Controller" --add ide
VBoxManage storageattach Win7-64bit-VM1 --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium /root/ISOs/Windows_7_64-bit_Home_Premium_x64.iso
VBoxManage modifyvm Win7-64bit-VM1 --boot1 dvd --boot2 disk --boot3 none --boot4 none
VBoxManage modifyvm Win7-64bit-VM1 --memory 2524 --vram 256
VBoxHeadless -s Win7-64bit-VM1

*** Note that the HDD is 32,7 GB and the RAM is 2,5 GB ***

Make sure to change the ISO path to your ISO file:

/root/ISOs/Windows_7_64-bit_Home_Premium_x64.iso

To start the VM with VRDE (Remote Desktop Server) enabled, run the VM like this:

VBoxHeadless --startvm Win7-64bit-VM1 --vrde on

You can now use Windows Remote Desktop Client to connect to your VM!

When you don’t need anymore the VRDE, you can disable it:

VBoxHeadless --startvm Win7-64bit-VM1 --vrde off

References:

Create VirtualBox VM from the command line
Chapter 7. Remote Virtual Machines

Updated on July 25, 2019 at 11:01 am

Receive updates via email

Other Posts

Updated Posts