X + Remote controlling software >
This was a significant interest for paired programming during my Ruby mentoring days.
See also:
Multiple X sessions ∞
Tested 2009-04-19 on PCLinuxOS 2007.
Assuming you are already in an X session (control-alt-F7
).
For a vanilla X session, in a terminal, do:
\nohup \X :1 >> /dev/null&
Now a new X session begins (session 1).
- session 0 is
control-alt-F7
(the original one) -
session 1 is
control-alt-F8
(the new one)
From your original session, you can force the new one to run commands, like a window manager (for example, Openbox), like so:
DISPLAY=:1 \nohup \openbox >> /dev/null&
Note that some commands have a -display
parameter which you could also use.
- Questions:
- How can I launch a new X session without being forced to switch to it?
-
How would I remotely shut down an X session?
- Gotchas:
-
Make sure that you can
control-alt-backspace
to kill an x-session.- I don't know how else to exit.
- tricks
You can also clone your present setup (window manager, startup scripts, etc), like this:
\nohup \startx :1 >> /dev/null&
You can edit your X startup scripts if you wish, and do much fancier things. For me, it's Xsession.
Other possible methods ∞
Several window managers (including cwm(1) and fvwm(1)) offer the ability to change window managers on the fly, without restarting X or any of your applications. Your new window manager replaces your old one, exiting the newly loaded window manager terminates X, it does not return you back to your previous window manager. fvwm(1) allows you to start a different window manager by left clicking on the background ("root window"), chose "(Re)Start", then pick your preferred window manager (however, note that you will need to add your alternative window managers to your .fvwmrc file (the system-wide default is /usr/X11R6/lib/X11/fvwm/.fvwmrc)). cwm(1) allows you to invoke another window manager by hitting Ctrl-Alt-w, and typing in the manager you wish to switch to.
-
this Fedora post (archived) has some scripting magic..
Multiseat - Two users sharing the same X11 desktop ∞
notes ∞
previous failure ∞
Assumptions:
- You're presently in an X terminal
- You have access to root
-
SSH is installed and will work for localhost
- Maybe just
service sshd restart
- Maybe just
-
xnest, twm and xterm are installed
- Customize to your needs
# Setup: su - # become root adduser testhost -n -g users adduser testguest -n -g users # Set up passwords (your choice): passwd testhost passwd testguest exit # exit root
Spoiler
#!/bin/bash # Doesn't work # export DISPLAY=ipnumber:1 # Start the two users, and their applications echo "`control-alt-F7` to get back to your proper terminal." nohup X :1 >> /dev/null& sleep 2 DISPLAY=:1 nohup twm >> /dev/null& DISPLAY=:1 nohup xterm -fn 9x15 -bg black -fg gray -sl 10000 -geometry 80x24+0+0 >> /dev/null& # Using :4 because :3 wasn't very happy on my system. # Hrm, I want this to be on top, but it's not cooperating. DISPLAY=:1 nohup Xnest :4 -geometry 1024x768+10+10 >> /dev/null& DISPLAY=:1 xhost + & sleep 2 DISPLAY=:4 nohup twm >> /dev/null& DISPLAY=:4 nohup xterm -fn 9x15 -bg black -fg gray -sl 10000 -geometry 80x24+0+0 >> /dev/null& DISPLAY=:4 xhost + &
Spoiler
#!/bin/bash echo "`control-alt-F7` to get back to your proper terminal." nohup X :2 >> /dev/null& sleep 2 DISPLAY=:2 nohup twm >> /dev/null& DISPLAY=:2 nohup xterm -fn 9x15 -bg black -fg gray -sl 10000 -geometry 80x24+0+0 >> /dev/null& # DISPLAY=:2 nohup xterm -fn 9x15 -bg black -fg gray -sl 10000 -geometry 80x24+100+100 -e ssh testhost@localhost >> /dev/null& # Grab the same Xnest window DISPLAY=:2 nohup Xnest :4 -geometry 1024x768+10+10 >> /dev/null&
The guest can't grab the same Xnest. Damn.
(see scripts)
control-alt-F7
to get back to your proper terminal.
DISPLAY=:2 nohup xterm -geometry 80x24+0+0 -exec "$SHELL" -c " ( ;\ cat << HERE_DOCUMENT ;\ #!/bin/bash ;\ DISPLAY=:2 nohup export DISPLAY=ipnumber:2 >> /dev/null& ;\ DISPLAY=:2 nohup Xnest :1 -display :2 -geometry 640x430+0+0 & >> /dev/null& ;\ HERE_DOCUMENT ;\ ) > ~/runme ;\ " >> /dev/null & # switch to session 2 with `control-alt-f9` # type in the password you created for testguest # disable remote access? # xhost - (IP) # xhost + localhost # Teardown: su userdel -r testhost userdel -r testguest service sshd stop exit
F7 - original
F8
F9
Using freenx ∞
An old note:
For faster remote desktop connection in ubuntu - install openssh, freenx server and nxclient. The speed will be amazing fast.
sudo apt-get install ssh
Installing freenx server
First:
https://help.ubuntu.com/community/SSH
https://help.ubuntu.com/community/FreeNX
Visit https://www.nomachine.com/download and download the nxclient for your platform.
For ubuntu you can download the .deb file, right click on it and install.
Hamanchi notes ∞
Some old notes..
https://www.logmein.com/ [ 1 ] was https://labs.logmeininc.com/
\wget --continue secure.logmein.com/labs/logmein-hamachi-2.0.1.13-x86.tgz tar -xvvzf logmein-hamachi-2.0.1.13-x86.tgz cd logmein-hamachi-2.0.1.13-x86 sudo install.sh sudo hamachi login sudo hamachi set-nick USERNAME sudo hamachi join SOMETHING SOMETHINGELSE
Applications > Internet > Remote desktop
OTHERUSERNAME will appear in the list on the left
double-click to connect
pass: PASSWORD
Check out non-hamachi vpn solutions. There's something built-in.
https://web.archive.org/web/20090221103756/http://forums.bit-tech.net/showthread.php?t=132029
Footnotes
Last updated 2021-03-14 at 19:43:22