Skip to main content

The Struggle with X11vnc Rebuilding Ubuntu Server

And then I got stuck again getting remote access to work. It’s funny out of all the great features, only the remote access is not the friendliest in Linux setup. There is no proper standard guide so far I could find on the internet for X11VNC. However, after a long spending trying out different guide that doesn’t work at all, I can now confirm only one guides actually tested working during my struggle.

Without doubt, this whole thing is funny and stupid. But as long the X11VNC able to work in startup on my headless server is all I need to access anytime. The first guide I follow is using the steps from Digital Drugs. I tested running the script below to confirm first before I proceed further.

start on login-session-start

script

/usr/bin/x11vnc -xkb -noxrecord -noxfixes -noxdamage -auth /var/run/lightdm/root/:0 -display :0 -passwd "MyPasswd" -forever -bg -o /var/log/x11vnc.log

end script

The TightVNC in my Window machine was successfully able to connect. Well, problem occurs. The password doesn’t recognize when I key in ‘MyPasswd”. So what went wrong? I have no idea to be honest. I went on looking on the previous guide by updating another code into the last script like below.

start on login-session-start

script

x11vnc -rfbauth -rfbport 5901 -auth /var/run/lightdm/root/:0 -display /etc/x11vnc.pass -forever -bg -o /var/log/x11vnc.log

end script

There are a lot changes and code remove in the script by following others. For example like the password column I replace with -passwd "MyPasswd" to sudo x11vnc -storepasswd /etc/x11vnc.pass in the script as recommended by many. Yet again, not working.

Frustrated as usual. I tried to remember to find my last bookmark and follow the steps of 'Setting up X11vnc' at Ubuntu Forum as shown below.

  1. Install x11vnc: sudo apt-get install x11vnc
  2. Set the password: vncpasswd ~/.vnc/passwd (vncpasswd is included with vnc-common, which is installed by default)
  3. Make it auto-start when the user logs in and show which port we're running on (useful if you run multiple vnc servers) the port will be put in ~/.vnc/port.txt: sudo gedit /usr/local/bin/sharex11vnc Paste in the following code:
#!/bin/sh

x11vnc -nap -bg -many -rfbauth ~/.vnc/passwd -desktop "VNC ${USER}@${HOSTNAME}"|grep -Eo "[0-9]{4}">~/.vnc/port.txt

# comment out the following if you don't want a popup telling you which port you're using.
zenity --info --text="Your VNC port is `cat ~/.vnc/port.txt`"


  1. sudo chmod 755 /usr/local/bin/sharex11vnc

  2. System->Preferences->Sessions->Startup Programs then click Add and type in sharex11vnc

Add the code and restart, it finally works. This got me into thinking, are those scripts above are all wrong in the first place? But I can ensure that the first script that I tried does indeed work, just the password doesn't work even I change the password code. I'm not good in Linux, so it's hard to argue unless someone from the experts point out the problem.

Comments

Popular posts from this blog

Brunei Second Online Store - Shopping.com.bn

I was actually surprised finding the second online store in Brunei other than QQeStore. I have no idea when they started their online business. But it’s good to have a competitor around, right? You might ask how it compared to the current rival QQeStore. Shopping.com.bn is still a long way competing to their rival. You will be able to find out easily why I said that once you visit the Shopping.com.bn.
Good things about Shopping.com.bn No registrations fee required Many of their products price can be comparable to QQeStore They bundle free extra accessories (selected items) Doing international ordering Now, why I won’t buy at Shopping.com.bn

Simple, their warranty for the products makes me laugh after I look into the camera and Dell section. Many look alright for me. However, it seems like they never done their homework properly before listing their product information online. Check out the pictures I snap online, what kind of mistake did they made after looking at it?

HAHAHA!! Are you …

Brunei Toy Convention 2015 - Exhibition (Star Wars)

For Star Wars fans!

Brunei Toy Convention 2015 - Exhibition (Die Cast/Plastic Cars)

BATMOBILE!!! So, who love cars?