x11vnc -display 0 -viewonly [-shared] -allow IPADDR -passwdfile ~/passfile.txt
On a Debian or Debian derivate such as Kubuntu, edit the following:
/etc/kde3/kdm/Xaccess, add a line with an asterisk on its own as follows:
|
Before: |
After: |
| #* #any host can get a login window
# |
#* #any host can get a login window * # # To hardwire a specific terminal to a specific host, you can
|
Edit /etc/kde3/kdm/kdmrc and change Xdmcp section from Enable=false to Enable=true
| Before | After |
|
[Xdmcp] Enable=false |
[Xdmcp] Enable=true |
No, restart KDM service :
/etc/init.d/kdm restart
You can login from a remote host , when the X server shows a login screen, Click Menu=>Remote Login. Enter the IP address or hostname in the Host: field and login with a valid userid/password combination.
The setup above is for demo purpose. It is very insecure. Once you get to this point, just add restrictions and note that X11 traffic is all unencrypted and can be sniffed easily by anyone.
XLive CD: Xwindow live CD for Windows desktops: ftp://ftp.ussg.indiana.edu/pub/xlivecd/xlivecd-20041201.iso http://xlivecd.indiana.edu/ Use just one keyboard and mouse to control your laptop and desktop at the same time: Install x2x on both machines. eg: apt-get install x2x On desktop: X -ac :0 & export DISPLAY=localhost:0 startkde & export DISPLAY=laptop:0 On laptop: From kde desktop, Open terminal x2x -west -to desktop:0
Nesting XWindows: sudo apt-get install xnest Xnest -ac :1 You should get a blank X win. This will be your DISPLAY #1. A client can set export DISPLAY=machine:1 and display into this window. See fluxbox running inside a window on KDE desktop
Remote X11 apps: On pc1: xhost +pc2 On pc2: export DISPLAY=pc1:0 xterm Xterm should be displayed on PC1 however it will consume computing resources from PC2 Remote X11 logins (XDMCP): Setup KDM or GDM to listen for XDMCP broadcasts. eg: edit /etc/kde3/kdm/kdmrc on Ubuntu Linux system running KDE.
PC_A wants to send its X display to PC_B On PC_B xhost +IP_PC_B On PC_A export DISPLAY=IP_PC_B:0.0 Open a ssh connection from PC_B to PC_A as follows: ssh -X IP_PC_B Any X program run on PC_A will send its graphical output to PC_B
startx -- -nolisten tcp
xhosts +local:
The X Window System doesn't really care if the X server and the X client run on the same machine. With a few configuration changes, you can easily run a remote X session on a local display.
XDMCP is the X Display Manager Control Protocol. In order to use it, you will have to login via a graphical login manager (GDM, KDM) on the machine which will act as the server (in X jargon, that's the client. Yeah, I know ...). I will assume that you're using the standard login manager on Mandrake Linux, KDM.
Configuration
Steps require 'root' privileges. Configuration has only to be done on the machine running the login manager.
Edit /etc/X11/xdm/xdm-config and put an exclamation mark in front of this line:
DisplayManager.requestPort: 0
Edit /etc/X11/xdm/Xaccess and remove the hash (#) in front of this line (if there is one):
* # any host can get a login window
Edit /usr/share/config/kdm/kdmrc and change
[Xdmcp]
Enable=false
to
[Xdmcp]
Enable=true
If you're using GDM, you can configure that in the advanced options field of gdm-config. Log out of your X session and log in again. Now go to the client machine, log into a console and run
X -broadcast
(notice that you can and should do this as non-root). The login screen of the remote machine running the display manager will come up and you can log in. All applications will run on the remote machine and the visuals will appear on the local machine via the network. To quit the session, log out and choose 'Close Connection' from the 'Menu' dropdown.
Since the local X server requires very little resources, this is a neat way to run a full blown graphical desktop on older machines.
Security
If it's simple, it's usually insecure. Same here. Only use XDMCP in trusted environments, there's no encryption whatsoever. XDMCP uses UDP port 177. Block that port in your firewall from all outside access (your firewall should block all non-needed ports by default, anyway ;-)). Check out more secure alternatives like tunneling X via ssh.
More information
Linux XDMCP HOWTO
Remote X Apps mini-HOWTO
man xdm
If you never want to run X programs on a remote machine to display on your local machine,then you may as well shut off this non-essential service
The -nolisten tcp is passed directly to the X Server. You may want to put this in a system startup file like /usr/X11R6/lib/X11/xinit/xserverrc or /etc/X11/xinit/xserverrc
The xhosts line means "trust all clients who are on local host". This is fine for a workstation with only one user, like a typical home machine.