Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start VirtualBox and VM in windows boot

I am running VirtualBox in Windows Server 2016. I want to start both VirtualBox and a VM within that when Windows boots. I have seen some posts about starting VB on Windows boot, but I have not gotten that to work. And even if I did, that would not auto start the VM. I feel there must be a way to do this, but hours of googling has not found the way.

like image 601
Larry Martell Avatar asked Aug 31 '17 01:08

Larry Martell


People also ask

How do I switch between Oracle VM and Windows?

You can use Alt + Tab to switch to a window from host anytime, without press the Host key first. But, you also can't switch within windows inside the vm, via Alt + Tab any more.

How do I make a virtual machine run on startup?

Just create a shortcut to <VirtualBoxDirectory\VBoxManage.exe> startvm "vmname" --type headless and put that in your startup folder. From the VirtualBox manual.


2 Answers

I have an example of how to autostart a VirtualBox VM during Windows startup. I'm running Windows 10, but it shouldn't be much different on Windows Server 2016.

The startup folder on my system is:

C:\Users\chriwill\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

In that folder I placed a batch file kubuntu.bat with following content:

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm kubuntu --type headless

In my example the VM is named kubuntu. You'll have to change it for your instance.

ADDON:

If you need help finding the startup folder on your windows instance press keys WINDOWS+R and enter shell:startup.

reference: https://www.virtualbox.org/manual/ch08.html#vboxmanage-startvm

like image 153
Christian Will Avatar answered Nov 10 '22 11:11

Christian Will


What worked for me was.

  1. Create a shortcut.
    • Open virtualbox
    • highlight the VM you want to startup
    • click "Machine" -> "Create Shortcut on Desktop"
  2. Add to windows startup
    • Start -> Run
    • type in "shell:startup"
    • copy & paste shortcut in here.
like image 21
Quang Van Avatar answered Nov 10 '22 11:11

Quang Van