A simple record of VNC server configuration for Ubuntu

Source: Internet
Author: User

Because of the recent special needs, I need to build a remote through the GUI for the maintenance of the cluster, of course, although the cluster, but the machine is only 7 PCs, plus the network environment restrictions, the real cluster is not a good place, so also on each Taiwan to deal with it.

Ubuntu's own VNC service is vino-server This service can be opened directly under the graphical interface, but unfortunately, after the reboot you have to log in again before you can login through VNC, this is not applicable to my environment, so need to install other VNC services, There are a lot of explanations in this wiki, but it doesn't even apply to me, so I install vnc4server myself:

1. Install Service:


2. Set the VNC password:

sudo vncpasswd ~/.vncpasswd

3 Setting Xstartup

CD ~/.VNC
ls./
#这里你会看到passwd  Xstartup These two files, if there is no xstartup, you can start the first vncserver it will be generated, and then edit the
VI Xstartup
So you can see these things:

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset Session_manager
# Exec/etc/x11/xini T/XINITRC

[-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" &
X-window-manager &

You don't have to call it the description of the annotation, directly modify the following line:

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset Session_manager
# exec/etc/x11/x INIT/XINITRC

[-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" &
#x-window-manager &
Gnome-session &

So we can telnet to the Gnome interface via the VNC viewer.


4. Test:

Vncserver:1-geometry 1280x800

This allows you to log on to VNC using a yourip:1 connection. No problem, just OK.


5. Auto Start:

sudo vi/etc/rc.local
#添加这一行:

su-yourusername-c "cd/home/yourusername/&& vncserver:1-geometry 1280x 2>/dev/null&; "


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.