Starting vboxheadless over ssh

Discussions related to using VirtualBox on Linux hosts.
Post Reply
peteb
Posts: 4
Joined: 5. Mar 2009, 20:54

Starting vboxheadless over ssh

Post by peteb »

I'm new to Linux, so forgive me if I'm missing something obvious.

Environment: VirtualBox 2.1.4 running on Ubuntu 8.10 Server, which means I am doing everything from the command line.

I have a Windows XP guest that I am running headless and using RDP to connect.
I have noticed that when I SSH into Linux and use VBoxHeadless to start my VM, the command line sits at Listening on port XXXX. Now, if I close my SSH putty window, my VM aborts.

My question is how do I start my headless VM and close my SSH session while leaving the VM running?
Why does the command line just sit at "Listening on port XXXX" and not go back to a command prompt? What if I needed to do other things like start other VMs?

Thanks,
Pete
slanbarn
Posts: 28
Joined: 11. Feb 2009, 10:22
Primary OS: Debian Lenny
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP, etc.
Location: Sweden

Re: Starting vboxheadless over ssh

Post by slanbarn »

Try

VBoxManage startvm "name_of_vm" -type vrdp
Does not get "stuck" at "listening on ...." on my machine at least...


You can change the default vrdp port with

VBoxManage modifyvm "name_of_vm" -vrdpport port_number
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Starting vboxheadless over ssh

Post by Sasquatch »

What you can do is open a screen session (you may have to install 'screen' first), run the VBoxHeadless command in it, then detach your screen session (Ctrl+A, D). Screen will keep running in the background, with your VM in it. You can now safely log off from your SSH session. See the screen man pages for more information. There are plenty of guides on the web too.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
sej7278
Volunteer
Posts: 1003
Joined: 5. Sep 2008, 14:40
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Solaris, Linux, Windows, OS/2, MacOSX, FreeBSD
Contact:

Re: Starting vboxheadless over ssh

Post by sej7278 »

screen is excellent for keeping sessions going, and the advantage of multiple sessions with only one ssh connection.

you can also use: nohup VBoxHeadless -v off -s 'Solaris 10u6' &
peteb
Posts: 4
Joined: 5. Mar 2009, 20:54

Re: Starting vboxheadless over ssh

Post by peteb »

Thanks all for the suggestions.

I'll have to look into using "screen". This seems to be the way to go as the VBox manual recommends using vboxheadless over vboxmanage.

Time to go learn more Linux (I love this stuff; it's nice to get away from the daily Windows grind)

Thanks again,
Pete
virtualpier
Posts: 12
Joined: 2. Jan 2009, 12:52
Primary OS: Ubuntu 8.04
VBox Version: OSE Debian
Guest OSses: Linux, Windows
Location: Italy

Re: Starting vboxheadless over ssh

Post by virtualpier »

Hi,

excuse me..

however screen is supposed to be used by a human...what if there is no human behind the keyboard?

i am experiencing a problem with a script (a function within a python script) which starts my VM (with VBoxHeadless -s vmname &) but ... doesn't return to the caller because VBoxHeadless is waiting...

Any advice?

Thanks
---
P
adumont
Posts: 5
Joined: 16. Jul 2009, 11:15
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: Debian, WinXP

Re: Starting vboxheadless over ssh

Post by adumont »

To have the VBoxHeadless return you can use nohup:

Code: Select all

nohup VBoxHeadless -startvm vmname &
it's what I do.
Post Reply