How can I run VirtualBox a different TTY?

Solution 1:

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.

Solution 2:

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.