8

I have a netbook and a server, to both of which I installed the identical Ubuntu 10.04 LTS distribution. On the server, I had the foresight to install and enable the SSH server before disconnecting the monitor and keyboard and mouse. I then ssh'ed in and enabled the VNC server as well. Now I want the full server experience on the netbook, but when I VNC in, I am greeted with the displayed screen. (names have been redacted)

image of vnc screen showing only one xterm

How do I start the rest of the default Ubuntu GUI experience? (the toolbars at the top) ((is that the window manager?))

4 Answers 4

7

install xfce4 and use xfce4 session, gnome VNC Server on Ubuntu sometimes does not display correctly

sudo apt-get install gnome-core xfce4 firefox nano -y --force-yes

and use this xstartup file

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
1
  • This sounded extreme to me, but I was frustrated with my inability to get gnome to work so I tried it and it did just work and that's about what I need (in fact, I just need to be able to move a Window so I can see what's behind it...)
    – sage
    Aug 23, 2016 at 18:49
6

Try editing the xstartup file:

vi $HOME/.vnc/xstartup

add following lines to the file

#!/bin/sh
unset SESSION_MANAGER
exec sh /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 1280x1024+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &

Start vnc server:

vncserver -geometry 1280x1024 -depth 24

If you are accessing your remote machine, then remember to forward the ports of vncserver.

2
  • 6
    This doesn't display anything, but a blank desktop. Aug 21, 2015 at 3:14
  • Pardon my ignorance, but doesn't exec sh cause all subsequent lines to be ignored?
    – mafu
    Jan 2, 2022 at 11:22
2

Don't use VNC. It's a horrible solution. Go with something like X2go (http://www.x2go.org/) instead. It's easily installed, extremely much faster than VNC and it's more flexible, providing things like PulseAudio. It also has a Firefox plugin so you can run applications from the server directly in the browser, etc.

0

I was frustrated with my inability to get gnome to work so I tried it like that

  1. sudo apt-get install xfce4

  2. modify .vnc/xstartxup like this

  3. run vncserver

  4. connect server via vnc viewer

  5. I can see windows manager

.vnc/xstartxup:

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
/usr/bin/startxfce4 &

#[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#/usr/bin/x-window-manager &

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .