How to troubleshoot x session issue

Posted March 22, 2014 6k views
Hi! I'm new to Linux, I'm running a Ubuntu 12.10 x64 desktop, was on 512MB RAM. I installed a vncserver and was able to use tightvnc viewer to login remotely, but quickly run out of RAM after installed wordpress. I upgraded droplet to a 2GB RAM, when I access tightvnc, I can't login any more, get connection refused message. I'm not sure where went wrong, how to fix this issue… Please help!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers
To stop a vnc
vncserver -kill :#
where # is a number, incrementing every time you run the vncserver command. Each number represents a virtual display and each has its own session.

I would recommend against a vncserver on the droplet, because of the amount of resources it takes to run the desktop environment. Plus, if you forget to terminate the vncserver when you're done, it will just hog more resources, wasting RAM. Not having a vncserver will also save you disk space, but hey - it's your server, not mine.

I recommend doing everything remotely. Don't setup wordpress from the browser on your droplet. Don't even install a browser on your droplet. Do that from your computer instead. Use FTP/sFTP to transfer files between your computer and the server Filezilla is great for this. Use SSH to access the terminal. PuTTY is great for this. If you have a webserver running on your droplet, you can access it just like a website. In your browser's address bar, put the IP address of your server.

The more unnecessary stuff you install on your server, the more resources you waste and the more possible security holes you open.

Now that that's out of the way, can you please clarify what you mean by "I can't login"

SSH: you can access an emergency terminal from your Digital Ocean control panel

TightVNC: This usually means the VNCserver crashed, or Linux ran out of ram and pkilled your VNCserver to free up RAM.
You'll have to restart the VNCServer to access it again. In this case there are usually some temp files you have to remove because the VNCServer crashed before it got a chance to remove them. Without removing them, the next time you start VNCServer it will think a virtual display is already open, so it will open on the next available spot (incrementing 1).

Most likely your problem is the "TightVNC" one.

For installing Wordpress, you have 2 options.

1: Install manually. A detailed guide is here:

2: Install a droplet with Wordpress already installed. If you just installed your droplet, I would use this option. This is the fastest option.
by Etel Sverdlov
WordPress is a free and open source website and blogging tool that uses php and MySQL. It was created in 2003 and has since then expanded to manage 22% of all the new websites created and has over 20,000 plugins to customize its functionality. This tutorial shows how to install WordPress on a server with LAMP. It is written for Ubuntu 12.04.
Thanks for reply, much appreciated!

Yes, the virtual server seems very memory hogging.
Now I have 2GB RAM, LAMP+WP, vnc on it, over 1quarter RAM already gone,
not sure how long RAM would last, to simply run a picture-riched blog.

I'm running VNC only to use browser there to gain full internet access.
How do I know how many display I already run for vncserver?
I run vncserver -kill :1, get following result:
Can't find file /home/username/.vnc/
You'll have to kill the Xtightvnc process manually
Does this mean there is no session open at this time?

I think 2 times I didn't close properly, one time I couldn't login remotely, so 2nd time I run from web console,
but resolution too big for web console screen, can't see anything, have to reboot… shoot me!

When I say I can't login, I'm using tightvnc viwer on Mac to login remotely to ip_address:5901
When click "connect" on tightvnc-viewer.jar, it give error: couldn't connect to ip@:5901, connection refused.
There is no hint what cause the problem, as I can login before a few times,
now I increased RAM and copied image from old droplet, password remains the same.
It could be crashed due to previous insufficient memory, but I don't know how to recover.

In /tmp, I delete everything including hidden file, but I still can't login from tight-vncviewer.jar, same error message
How to remove everything and re-install? Would it be faster?
-rw------- 1 vnc vnc 418 Mar 22 09:09 .xfsm-ICE-Y77UCX
-r--r--r-- 1 vnc vnc 11 Mar 22 09:09 .X1-lock
drwxrwxrwt 2 root root 4096 Mar 22 09:09 .X11-unix
-r--r--r-- 1 root root 11 Mar 22 09:09 .X0-lock
drwx------ 2 vnc vnc 4096 Mar 22 09:09 ssh-Xyc6JXFzXGM8
drwx------ 2 vnc vnc 4096 Mar 22 09:09 pulse-PKdhtXMmr18n