Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was wondering if it's possible to run an Ubuntu virtual machine using VirtualBox in background, I mean, without any window open.

The idea is to connect via SSH to the Linux host, that would be running in background.

Has anyone ever done something like this? Is it possible?

share|improve this question
You mean connect via SSH to the linux guest? You can do this very easily with QEMU which will actually run the guest in your terminal. –  Felix Apr 28 '10 at 12:13
So you also may be interested in the SSH configuration: superuser.com/questions/424083/virtualbox-host-ssh-to-guest –  Fabricio PH May 23 '14 at 20:20
possible duplicate of How can I start a VM without getting a window? –  Randall Flagg Sep 10 '14 at 12:01

9 Answers 9

VBoxManage startvm $VM --type headless will start the specified virtual machine in the background.

To shut it down, request the shut down from the guest.

share|improve this answer
You will only be able to SSH into the machine if you've setup networking properly. I think you need to use bridged so that the VM and your machine are on the same network. Also, VirtualBox will still run the gui of the target OS and you can connect to it via remote desktop, "rdesktop" (get from apt since you're in ubuntu) –  basszero Apr 28 '10 at 11:36
True. I assume that the VM is run usually through the VirtualBox GUI first to get it installed and configured. Only use VBoxManage once everything (including networking) works. –  developmentalinsanity Apr 28 '10 at 11:48

This is built into VirtualBox 4.2, simply hold down Shift when launching the VM from the Manager.


share|improve this answer

Absolutely! You are looking for a headless installation (Virtualbox). The way to start the machine from the command line is something like:

VBoxHeadless --startvm Debian --vrdp=off

However you will need some way to connect. What I do is mapping ports between guest and host. With this configuration, your host 2222 port will be mapped to port 22 of your guest machine.

VBoxManage setextradata "Debian" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP  
VBoxManage setextradata "Debian" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22  
VBoxManage setextradata "Debian" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222  

After that you can log in with:

ssh localhost -p2222
share|improve this answer

I don't think seamless mode is quite what he's looking for here, I think the proper thing would be VBoxHeadless which details of you can find in the manual. It runs using a command-lin interface and would be used, for example, if a virtual machine was running on a server but the display was not wanted from the server. You will be able to remote desktop onto the machine (providing you know how to set the option via command line).

I would reccomend asking this in the virtualbox forums. Actually, do a search first as I expect this has already been asked.

VBoxManage was the right thing, sorry. Link the info in the manual http://www.virtualbox.org/manual/ch08.html

share|improve this answer

I'm using VBoxTool from http://vboxtool.sourceforge.net/ and it works perfectly for me. It can autostart VMs at boot and stop/save VMs at shutdown and provides a simple clean command line interface.

share|improve this answer

I found that the headless mode seems to work fine when backgrounding in Linux (CentOS 5.6), but you lose access to the RDP functionality as long as the process is backgrounded. Do an 'fg' to bring the process back to the foreground, and RDP functionality is restored. Looks like starting the vm headless is best accomplished through an init script, where interactivity with the console is not required.

share|improve this answer

Something like "Seamless mode" ? Its very much possible with VMware's Unity mode.

share|improve this answer

an alternative to VBoxManage startvm "{VMName}" --type headless is
VBoxHeadless -startvm "{VMName}"

Amusingly enough, I just finished figuring out how to run a VM headless, over RDP.

Note - At least on windows, it will block your command window. If you need to continue using your console window, open another to start the VM in.

To shut the VM down, you request the Guest OS to shutdown. VBoxHeadless releases the console when the Guest is fully shut down (You can Ctrl+C, but I think it may be analogus to a hard reset on a real machine).

share|improve this answer
The fact that vboxheadless blocks the console very much defeats the purpose of a headless mode. On Mac OS X (and presumably on Linux and Solaris) the headless mode works when you send vboxheadless into the background using &. –  Andrew J. Brehm Apr 28 '10 at 11:48
I'd imagine there is a way to do that on windows, I just haven't found it. In any event, a headless vm certainly uses less resources on the server computer than one running a full GUI. –  Fake Name Apr 28 '10 at 12:20

I've added these lines into my .bashrc:

alias vm='VBoxManage startvm $VM --type headless'
alias sshvm='ssh -p2222 localhost'

For ssh access you don't need to change the configuration just keep the NAT and you can set up port forwarding table as following:

Name      | Protocol | Host Port | Guest Port
guestssh  | TCP      | 2222      | 22
localhost | TCP      | 8080      | 80

When you insert localhost:8080 into your machine browser the page from VM (on port 80) will be opened.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.