12

My knowledge of Ubuntu is still fairly limited, but I know I can switch terminals with Ctrl+Alt+F*.

I was just wondering if it's possible to load my VirtualBox (winXP in this case) in one of those, that would be super handy. I currently have it set to auto-load on the right of my 2 Workspaces, but still it sometimes messes up the host-key and stuff.

Just wondering!

2
  • Great question, helpful to know how to run other applications in different virtual terminals as well. You learn something new every day. Sep 25, 2011 at 23:30
  • > because using a second X server makes you lose sound from the main X > server too. Just for the record, this is no longer true. I was listening some dubstep on my ncmpcpp (in a lilyterm inside my awm) and did the commands above, but not from inside X but from another tty (let's say alt+F2 ) and went on Windows XP inside virtualbox in VT8 and heard that nice feel-like-home sound that welcomes you (by this, you have two X server running parallel and if one crashes, the other wont necessarily).
    – user86454
    Aug 30, 2012 at 6:54

2 Answers 2

13

You cannot get the VirtualBox GUI running in the virtual terminals 1 - 6, only 7 and 8. Basically, you need to start the X server on VT8 and make programs run on it.

If you do not need window borders and a titlebar (because you're running VirtualBox fullscreen anyway) or other fancy display manager functions like Alt + Tab, you will be fine with a simple X server. Note that this may not be compatible with user-switching or re-logging when the main X server crashed.

Start a detached X server

sudo X -quiet -nolisten tcp -noreset :4 vt8

This will switch you to VT8 (Ctrl + Alt + F8) which is initially black. Switch back to GDM/KDM?whatever at VT7 by pressing Ctrl + Alt + F7. To run Virtual Box in VT8, run:

DISPLAY=:4 virtualbox &

This command first sets the environment variable DISPLAY to :4 and then runs virtualbox. You need to switch manually to VT8. Notice that you don't have a title bar nor a window border. To quit the application, use the File -> Quit option. To stop the xserver, first determine the process ID of your X server (using ps uww -C Xorg | grep :4) and then run sudo kill PIDHERE.

This is somehow advanced stuff, I recommend to stay using different virtual desktops (Ctrl + F<number-of-desktop> because using a second X server makes you lose sound from the main X server too. If virtualization is not a requirement, consider using wine.

3
  • Since both of you advise against it, I'll leave it alone. I guess if the Host-key would work 100% of the time (rather than 60% which it does now, and I've not found a solution to that) I wouldn't even need it. I'm running Photoshop, Illustrator, Office 2007 and Sony Vegas in my winbox, and I've gotten used to it so I see no need to transfer to wine. Thanks!
    – joon
    Sep 25, 2011 at 20:57
  • I've set my host key to Right Ctrl. Be sure to give the focus to VirtualBox before pressing the host key.
    – Lekensteyn
    Sep 25, 2011 at 21:30
  • I've tried a lot of different keys and defaulted back to Right Ctrl. Sometimes I have to hit it 10 times for it to work, sometimes it just works, sometimes I have to do Ctrl+F to be able to get back to Ubuntu...
    – joon
    Sep 25, 2011 at 21:36
1

VirtualBox is an X11 application. X11 (or the "X server") is the software layer between all modern GUI applications and your graphics card. Typically X runs on virtual terminal 7. While it may be possible to have an X server work with two virtual terminals or to run two X servers (connecting to the same graphics card, monitor), this is not common and I wouldn't recommend it. (Switching between virtual terminals, which is often connecting with switching the mode of the graphics card, is never perfectly smooth and fast.)

You should learn how to configure workspaces such that they work well with your VirtualBox setup.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .