Ubuntu 9.04 remote desktop using vncserver without monitor

Only few more days for Ubuntu team to release 9.04 but I couldn’t wait so I downloaded RC version and installed on torrent download server 😉 . The task is to install the ubuntu 9.04 RC and to completely manage the server remotely. The installation was completely smooth and there was no issues. The installation completely detected all the hardware and everything worked perfectly like a dream come true.

Ubuntu comes with remote desktop manager. I tested the same and it would not work when there is no monitor connected to the system. I tried different methods and nothing worked out for me. So I decided to ditch the built in remote desktop and installed vncserver.
#sudo apt-get install vnc4server

After it is installed you should be logged as normal user and not root.
#vncserver :1 -geometry 1024x768 -depth 16

Once you issue the above command it will prompt for password. This password will be used for connecting to the server. Once it is complete we can change the setting for the server. Before we do that we have to kill the server.
#vncserver -kill :1

The configuration is kept in the file /home/userxx/.vnc/xstartup I edited this file so that I can start the server with gnome. My file looks exactly like below.
#!/bin/sh

Now everything is done. All you have to do is to restart the system which is good for the setting to work properly. One you have restarted please start the vnc server.
#vncserver

I used chicken of the vnc to connect from mac.
After connecting you get gnome session which you can keep it alive even if the chicken vnc is closed.
Now all set and I don’t want my server to start gnome session during boot. To avoid that I have to disable gdm server.
That’s all folks have a nice day 😉

How about that :-
root@ServerU904:~# uname -a
Linux ServerU904 2.6.28-11-server #41-Ubuntu SMP Wed Apr 8 05:29:01 UTC 2009 x86_64 GNU/Linux
root@ServerU904:~# apt-get install vncserver
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package vncserver is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package vncserver has no installation candidate

I was also experiencing one more issue:-
Editing xstartup as usual didn’t help. VNC connection just started only one X-term for me (?) and i had to issue /usr/bin/gnome-session in X-term to get real Gnome Desktop.
P.S.
Environment:-
Ubuntu 0.04 Server (amd64) with Ubuntu Desktop installed via tasksel.

Hi there, I tried to install vncserver, but got the following error with the same command you used, I was wondering if you had a similar issue or if it is new.

bagside@bagvapp:~$ sudo apt-get install vncserver
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package vncserver is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package vncserver has no installation candidate
bagside@bagvapp:~$

Great! This worked like a charm. I’ve been trying to get this done for a long time now. The “easy” way (startx && gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true) won’t work if there is no monitor; today I had to plug one in, so I thought I’ll have a look at the reconfigured xorg.conf and use the settings there when there is no screen plugged in, but that didn’t help either.

Fortunately I found this post. I’m so happy 😀

For those getting only an xterm after login to vncclient, try adding one more line at the end of ~/.vnc/xstartup:
/usr/bin/gnome-session &

I tried the solution, but my ubuntu system still hangs at the “low graphics error” when I boot headless. There are other options at startup like ” GNOME settings Daemon” , “GNOME Settings Daemon Helper” , “GNOME Keyring Daemon” . Should I disable these services too?
if I need to boot up with a monitor later would I need to do any changes?

Please help. I really tried my best to make this working, i followed all the instructions line by line.
I also disabled apparmor (you never know…) but no goods.
Client refuses to connect (error 10061, connection refused).
The log file reports:
Couldn’t open RGB_DB ‘/etc/X11/rgb’

Hello!
after doing above steps and rebooting server, in terminal i wrote vncserver and i can’t connect.
log file as below, please advise! I am new to linux and need remote GUI, Thanks.
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/d4:1.log

evolution-alarm-notify-Message: Tue Oct 27 17:01:59 2009
i thinks it must be working now , but i still can’t connect, i think it needs a confirmation from server
i checked it in a near server and had this optoin :
Ask you for confirmation: Select this
option if you want remote users to ask you for confirmation when they want
to share your session. This option enables you to be aware of other users
who connect to your session. You can also decide what time is suitable for
the remote user to connect to your session

I followed the steps you described and now everytime I log in to my computer all the programs that run on the startup are ran twice! It seems as if something in the steps messed up with the startup of the system! Help!

It worked for me. I wanted my media center(xbmc on ubuntu) to have one more remote desktop. This helped me to create another one, which is different than the console, where TV is connected. Ubuntu’s remote desktop access using vnc provides the main TV screen, which is no use as that will be playing main movie, tv show etc. Access that output from network is useless as my output 1080p and getting that via vnc/network is stupid idea.

Now only thing I missing her
—-Rusian mentioned
I followed the steps you described and now everytime I log in to my computer all the programs that run on the startup are ran twice! It seems as if something in the steps messed up with the startup of the system! Help!
—

If you use openvpn to connect to the server from remote, and then use VNC, you can create a very simple but effective secure server access, without using SSH, (which is not always desirable.) You can have several sessions open for several users. Just type vncserver after switching on your root user session to the user you want to grant access.

So:
Set up an openVPN access for every user you want to grant access (including yourself:) )
start your VPN session, so you can acces your server by LAN-IP (192.168.2.5 for example could be your server IP)
connect VNC to your local server LAN-IP address, (192.168.2.5:5900 or 192.168.2.5:5901, depending you have set the default VNC session to session 0 or session 1)
in the console, switch to user X (sudo X)
in the console, type “vncserver”, and it will open a VNC session for window #1 or #x.
user X can now start a VNC session by connecting to 192.168.2.5:590x

Done.
Even several sessions at once for different users are possible now.

TIP: You can use this technique also for looking with two persons at the same session. Ideal for explaining, tutorials or just working together in one session. Open your skype alongside, and there you go, you’re in one office.