Page 1 of 1

Starting vboxheadless over ssh

Posted: 5. Mar 2009, 21:08
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

Re: Starting vboxheadless over ssh

Posted: 5. Mar 2009, 23:12
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

Re: Starting vboxheadless over ssh

Posted: 6. Mar 2009, 00:51
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.

Re: Starting vboxheadless over ssh

Posted: 6. Mar 2009, 12:02
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' &

Re: Starting vboxheadless over ssh

Posted: 6. Mar 2009, 16:22
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

Re: Starting vboxheadless over ssh

Posted: 28. May 2009, 18:40
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

Re: Starting vboxheadless over ssh

Posted: 16. Jul 2009, 11:18
by adumont
To have the VBoxHeadless return you can use nohup:

Code: Select all

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