VirtualBox syntax for creating a headless Win2012 guest on a CentOS7 host
The virtual machine name is "Cindarella". The user owning the files is vboxadmin.
- To check your possible operating system types:
vboxmanage list ostypes
- Make a VDI drive, 120gb
VBoxManage createhd --filename /home/vboxadmin/vboxes/Cindarella/Cindarella_OS.vdi --size 120480
- (repeat as needed; this example used some VDI files that were already available)
- Create the machine, then adjust settings
vboxmanage createvm --name Cindarella --ostype Win2012_64 --register --basefolder /home/vboxadmin/vboxes VBoxManage modifyvm Cindarella --memory 2000 --acpi on --nic1 bridged --bridgeadapter1 enp2s4
- Enable the remote desktop "VRDE" feature (after having controlled the firewall for the selected port)
VBoxManage modifyvm Cindarella --vrde on --vrdeport 4321 vboxmanage storagectl Cindarella --name "SATA Controller" --add sata --portcount 3 --bootable on
- Make use of some existing VDI images
- Note port changes from 0 to 1 to 2 for each of these hard disks.
VBoxManage storageattach Cindarella --storagectl "SATA Controller" --device 0 --port 0 --type hdd --medium /home/vboxadmin/vboxes/Cindarella/Cindarella_OS.vdi VBoxManage storageattach Cindarella --storagectl "SATA Controller" --device 0 --port 1 --type hdd --medium /home/vboxadmin/vboxes/Cindarella/Data_DriveD.vdi VBoxManage storageattach Cindarella --storagectl "SATA Controller" --device 0 --port 2 --type hdd --medium /home/vboxadmin/vboxes/Cindarella/Scratch_DriveE.vdi
- Put an ISO in the CD drive
VBoxManage storagectl Cindarella --name "IDE Controller" --add ide VBoxManage storageattach Cindarella --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium /home/vboxadmin/vboxes/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_SERVER_SOLUTION_EN-US-IRM_SSSO_X64FRE_EN-US_DV5.ISO VBoxManage modifyvm Cindarella --boot1 dvd
- Start VirtualBox in Headless mode
vboxmanage startvm Cindarella --type headless
- Reset the VirtualBox
vboxmanage controlvm Cindarella reset
- Power off the VirtualBox
vboxmanage controlvm Cindarella poweroff