HOWTO: Set up VNC server with resumable sessions
来源:互联网 发布:宝宝学说话软件 编辑:程序博客网 时间:2024/04/30 04:03
1. Enable XDMCP
sudo gedit /etc/gdm/gdm.conf
then find this rule:
# The greeter for xdmcp logins, usually you want a less graphically intensive
# greeter here so it's better to leave this with gdmlogin
# RemoteGreeter=/usr/lib/gdm/gdmlogin
remove the '#' in the last line so there should be:
# The greeter for xdmcp logins, usually you want a less graphically intensive
# greeter here so it's better to leave this with gdmlogin
RemoteGreeter=/usr/lib/gdm/gdmlogin
Note: Before doing the next step, you need to make sure the extra repositories (e.g. universe) are enabled:
http://easylinux.info/wiki/Ubuntu#Ho...a_repositories
2. Install required packages (vncserver and xinetd)
Code:
sudo apt-get install vnc4server xinetd
Note to AMD64 users: The current version of vnc4server in the repositories has a bug, so you need to download and install the fixed vnc4 packages as shown below:
Code:
wget http://qt1.iq.usp.br/download/vnc4server_4.0-7.3_amd64.deb wget http://qt1.iq.usp.br/download/xvnc4viewer_4.0-7.3_amd64.deb sudo dpkg -i vnc4server_4.0-7.3_amd64.deb sudo dpkg -i xvnc4viewer_4.0-7.3_amd64.deb
3. Set the VNC passwd
Code:
sudo vncpasswd /root/.vncpasswd
4. Add vnc service to xinetd:
Code:
sudo gedit /etc/xinetd.d/Xvnc
Enter this into the new file:
Code:
service Xvnc { type = UNLISTED disable = no socket_type = stream protocol = tcp wait = yes user = root server = /usr/bin/Xvnc server_args = -inetd :1 -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd port = 5901 }
5. Restart xinetd (usually there is no need to reboot, but occasionally it might be required)
Code:
sudo /etc/init.d/xinetd stop sudo killall Xvnc sudo /etc/init.d/xinetd start
6. That's it! To test that this is working first try to connect from the same machine (the machine we just set up the VNC server on):
Code:
vncviewer localhost:1
You should be prompted for the VNC password, and then see the GDM login screen where you can login and start a new X session. If that works, you can now go ahead and try to connect from remote machine using your favorite VNC client (remember to first close the local vncviewer we started above). Remember to use the VNC server machine's domain name or IP address, followed by :1 (e.g. 192.168.0.100:1). If connecting locally as shown above works, but connecting remotely fails, then this means you have a problem with a firewall which is blocking some ports. See the notes below about how to deal with that.
Note about ports: The VNC server set up as shown uses TCP port 5901. If you are using firewall software (e.g. firestarter) on that machine, you need to allow incoming connections on this port. If you are using a router which assigns your machine a private address (e.g. 192.168.0.100) which is not accessible from the internet, then you need to forward TCP port 5901 from the router to this machine.
Note about security: This setup allows any user to start an X-session remotely by logging in using his regular password (after starting the VNC connection using the VNC password), so if the user disconnects without logging out, any other user which knows the VNC password can connect afterwards and resume the same session that the first user started. So if you do not want to log out before disconnecting, it's advisable to at least lock your VNC X-session screen. Also note that while a remote user is connected thru VNC, no other connection will be accepted. An idle VNC client will be disconnected after one hour, but this can be changed by using the "-IdleTimeout" option in the server_args line in /etc/xinetd.d/Xvnc. For example, you can add "-IdleTimeout 300" to change it to 5 minutes.
ps. This was copy/pasted from a few posts made by Tichondrius and elemental666. I simply putted them together and tested everything! It works here for me now.
additional :
enable remote login
system -> administration -> login Window
remote tab
choose "same as local"
problem:
get mine working
when I do: "vncviewer localhost:1"
I get:
vncviewer: ConnectToTcpAddr: connect: Connection refused
Unable to connect to VNC server
resolution:
System->Administration->Login Window
Click on Remote Tab
Changed style to "Same as Local"
Click on the "Configure XDMCP..." buton
Uncheck "Honor indirect request"
Click Close on both windows
- HOWTO: Set up VNC server with resumable sessions
- Set up the VNC Server in Fedora
- HowTo: Set up Ubuntu Desktop with LVM Partitions
- set up ftp server with vsftp
- HOWTO SET-UP A CRONTAB FILE
- HOWTO set up a MySQL Cluster for two servers
- samba server set up(redhat)
- Set Up A Full-Featured Mail Server With iRedOS: MySQL, Postfix, Dovecot, ClamAV, SpamAssassin, RoundCube/SquirrelMail
- How to Set Up an IKEv2 VPN Server with StrongSwan on Ubuntu 16.04
- How to set up tomcat with server authentication and client certificate authentication enabled
- Set up your own PBX with Asterisk
- Set up remote profiling with JProfiler
- Linux Set Up Routing with ip Command
- Vino& VNC server auto start after Ubuntu boot up
- Set up SVN server on CentOS
- Set Up Git Server through SSH Connection
- set up pxe server in uefi mode
- Set Up a LAMP Server on Gentoo
- So let me talk something about MVC for Web.
- Remote Desktop from Windows to Linux
- 别让垃圾邮件酿危机
- 换了个公司
- ESOE Specification v0.1
- HOWTO: Set up VNC server with resumable sessions
- 河莉秀寫真[新版]――又要挫折女性們
- 科普:带你一起了解TELNET 【 so easy 】
- 精华游戏算法整理
- DotNET WinForm FAQ 16个
- Linux 使用点滴
- 人生的真相
- Javascript Implementation V0.2 for ESOE
- IT观察:MSN故障背后是否有“不可告人”的目的