Installing VNCserver on CentOS 5.7 and Ubuntu 11 for remote desktop in Windows
I run an Apache web server from my home. It is basically used to create test and development websites for my domains. The problem I was experiencing was how to allow my son and others work within a desktop in CentOS similar to Windows.
I decided a good method would be VNC. The first step is to set up the vncserver to deliver a desktop to remote sessions. I like the concept of connecting via HTTP, because we all have web browser.
You can enable HTTP access to a remote desktop on the web server with VNCserver. You can also create separate accounts for each user to view his or her own desktop. Security can also be maintained through the granting of rights and privileges for the session. Here are the steps I took to allow my son to work on his website through a web-based, VNC session on his Windows 7 laptop.
So if this is what you are looking to do with Windows 7 and Internet Explorer to access a Linux desktop, then read on to see how it is done.
CentOS 5.7 : Install vncserver via yum
Ubuntu 11: Install X11VNC Server via sudo apt-get intall x11vnc.
CentOS 5.7 set-up after installing vncserver.
- Add user to server.
sudo /usr/sbin/useradd thefrugaltech
sudo passwd mikey (to assign a password to the account) - Install vnc-server
sudo yum install vnc-server - Provide VNC user with password
sudo su – thefrugaltech
Run:vncpasswd
Password: New Password
Verify: Type New Password again
Logout as user by typing “exit” - Vi /etc/sysconfig/vncservers
Edit: VNCSERVERS=”2:myusername” to read VNCSERVERS=”2:thefrugaltech”
Edit: VNCSERVERARGS[2]=”-geometry 800×600 -nolisten tcp -nohttpd – localhost” to read VNCSERVERS=”-geometry 1024×768″ - Start vncserver
su – root (provide root password)
/sbin/service vncserver start (if it does not start due to permissions issues ensure you are using an account with sudo rights) - Change the xstartup options for the user account created in step 3
su – root
vi ~thefrugaltech/.vnc/xstartup
Uncomment: “unset SESSION_MANAGER” and “exec /etc/X11/xinit/xinitrc” - Open Internet Explorer on your Windows. Goto “http:<ip of vncserver>:5802” click “OK” for the session and enter the password for the user, then press OK.
Ubuntu 11 set-up after installing x11vnc
- Run: vncpasswd (This will set the current users password).
- You can log out of the session or simply restart the server.
- If you are viewing from a Windows server or PC install RealVNC viewer. Open the viewer and type in the Ubuntu 11 server’s IP address.
- You should see the desktop.
Not working?
- Ensure Java is installed on the PC.
- If you are not getting a GNOME desktop, check the default settings for new users. What I found to be expedient is to log the user into a desktop session.