17

For some reason I want to have 2 GUIs open at different TTYs.

the commands

sudo service lightdm stop/start

will stop/create a new GUI at TTY7. but how can I do the same at different TTYs or redirect its output?

mewais
  • 407
  • 2
  • 6
  • 17
  • 1
    probably not possible without some serious coding. see lightdm.conf. tty7 is hardcoded here (and in other places). edit; have a look at this: https://help.ubuntu.com/community/MultiseatX – Rinzwind Apr 04 '14 at 18:13
  • 1
    as @Rinzwind said it is not possible, in the same user environment. But you can check this question, may be one of answers will fits you – c0rp Apr 04 '14 at 18:19
  • 1
    it used to be possible @c0rp (I used to change /etc/inittab and have kde on tty8 and gdm on tty7) lightdm though seems to be very light(as the same stated) multiseat might work but it will take some configurationing – Rinzwind Apr 04 '14 at 18:21
  • 2
    interesting topic: http://ubuntuforums.org/showthread.php?t=2143902&page=3 – Rinzwind Apr 04 '14 at 18:26
  • @Rinzwind Here the correct sequence is login as another user in a VT and then startx -- :1. In my Ubuntu Gnome / gdm setup will start a new server on tty8. Tested just now. Probably the exact effect is dependent on the xinit scripts, so could be different between gdm , ligthdm and whatnot. – Rmano Apr 04 '14 at 22:25

3 Answers3

5
  1. Press Ctrl+Alt+F1(Desired Function key) this way you will switch to another tty

  2. After logging in to this console (Entering username and password) run this command: tty this will show you the number of current tty.

  3. To start Xserver also run this command (place value of returned tty number in place of n) and for your knowledge :2 is number of the $DISPLAY instance.

    startx -display :2 -- :2 vtn &
    

    Like I'm doing this for tty1 here:

    startx -display :2 -- :2 vt1 &
    

    at this point you can launch your graphical application though you can use this alternative instead of previous command:

    xinit session -- :1 -xf86config config.conf
    
  4. Next step is running a graphical program in TTYn:(like VirtualBox in Virtual terminal n)

    Start a detached X server (again replace n with tty number like:vt1):

    sudo X -quiet -nolisten tcp -noreset :4 vtn
    
  5. Run wathever application you want like VirtualBox, for example:

    DISPLAY=:4 virtualbox &
    

Note: Don't forget the you should enter all these commands just in dedicated tty (Ctrl+Alt+F1) and not in your graphical console.

Pablo Bianchi
  • 15,657
3

I just tested the above answer in response to jasonszhao's comment that it does not work. Using Ubuntu 16.04.2 LTS there were no issues with the commands.

Note:

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

"n" in "vtN is the tty number you want to run the graphical display. So in my case I ran

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

to start another X session on tty8 and then I used

DISPLAY=:4 virtualbox &

to start the program I wanted to run on DISPLAY:4.

Pablo Bianchi
  • 15,657
  • 1st command has to be faulty: 1 " can never be correct. And I end up with a black screen on tty8 with the last 2 commands. – Rinzwind Jul 13 '17 at 15:46
0

Just Goto another tty using Ctrl + Alt + F1 to Ctrl + Alt + F12 but you can return to Ubuntu default GUI using Ctrl + Alt + F7

I am using DDE in my case Ctrl + Alt + F2 then I use Ctrl + Alt + F1

startx

will start a fresh GUI

damadam
  • 2,833
  • 2
    It starts and immediately exists the X Session. How to run it and keep it running? – mnj Jan 01 '21 at 14:03