Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run "Oracle VirtualBox (VBOX)" like a service after boot in fully background "Microsoft Windows (WIN)"?

I want to run autostart "Virtual Machine (VM)" without "Oracle VirtualBox (VBOX)" "Graphical User Interface (GUI)" on local DEV machine with "Microsoft Windows (WIN)".

How can I do that in fully running background process?

like image 710
BGBRUNO Avatar asked Sep 26 '13 01:09

BGBRUNO


People also ask

How do I start VirtualBox as a service automatically?

Open VirtualBox and right click on the VM you want to autostart, click the option to create a shortcut on the desktop and close VirtualBox.

Does VirtualBox use UEFI or BIOS?

While BIOS-based machines are the standard for VirtualBox, in the real hardware world, almost all new PCs use EFI firmware. It's easy to use the new standard to set up Linux virtual machines, even if it is officially experimental.

How do I enable full screen mode in VirtualBox?

Press the "Host Key" and "F" simultaneously to enter full-screen mode. Alternatively, click the "View" menu at the top of the window and select "Switch to Fullscreen." This displays a dialogue box containing information about the full-screen mode in VirtualBox.


1 Answers

SOLUTION

The trick is to run the VM without GUI. With this you can easily run VM on WIN server like a service too.

Prerequired is that exist some VM, you have some already. Below put its name instead {vm_name}.


1) At first we use build-in executable file "VBoxHeadless.exe".

Create file

vm.run.bat 

with

cd "c:\Program Files\Oracle\VirtualBox\" VBoxHeadless.exe -s {vm_name} -v on 

run and test it - with WIN "Command Line Interface (CLI)" called "Command shell" - and VM will be opened running in background.

vm.run.bat 

2) Then we use "Windows-based script host (WSCRIPT)" and language "Microsoft Visual Basic Script (VBS)" and run above file "vm.run.bat".

Create file

vm.run.vbs 

put code

Set WshShell = WScript.CreateObject("WScript.Shell") obj = WshShell.Run("vm.run.bat", 0) set WshShell = Nothing 

run and test it - CLI will be run in background.

wscript.exe vm.run.vbs 

Ref

  • Thanks to iain
like image 93
BGBRUNO Avatar answered Sep 23 '22 17:09

BGBRUNO