Windows accesses Ubuntu through VNC

Source: Internet
Author: User
The record is prepared by the rookie who initially came into contact with Linux as the author: a machine with Windows XP or Windows 7, and a machine with Ubuntu (both can be virtual machines or physical machines: remote Access to Ubuntu through VNC on Windows. Introduction:. VNC (VIrtualnetworkCumputing) is a remote access method in Linux. It consists of two parts: VNCServer and VNCView.

The record is the first Linux cainiao as an author

Preparation: A Windows XP or WIN7 server and a Ubuntu server (both can be virtual machines or physical machines)

Objective: to remotely access Ubuntu through VNC on Windows.

Introduction:. VNC (VIrtual network Cumputing) is a remote access method in Linux. It consists of two parts: VNCServer and VNC Viewer.

The VNCServer is installed on the controlled machine, and the VNC Viewer is installed on the master machine. For example, if you want to remotely access Ubuntu through windows, windows is the master machine, which installs VNC Viewer,

Ubuntu installs the VNC Server on the controlled machine. (VNC Viewer http://www.realvnc.com/download/viewer)

Steps:

1. Install vnc on ubuntu.

$ Sudo apt-get install vnc4server

(A vnc4-common package is optional and contains some common features of vncserver and vnc viewer. For a specific description of the vnc4-common, see butler:

$ Sudo apt-get install vnc4-common vnc4server)

2. Start vncserver on Ubuntu. There are two ways to create a vnc desktop.

Method 1: Create a vnc desktop. The session number is automatically generated by the vncserver.

$ Vncserver

Method ② create a vnc desktop with the specified session number

$ Vncserver: 2 <-------------- create a desktop with the specified session number 2. Note the colon: there is a space in front

Note: A 6-character password is required when vncserver is started for the first time. This password is used for remote logon. Xstartup

3. You can modify the remote login desktop configuration to a graphical interface in either of the two ways. (Note: Only the root user can use a graphical interface. Other users are configured as graphical interfaces but will still be displayed as terminal interfaces)

Method ① modify the xstartup file (Note: each user has its own xstartup file). The file path is ~ /. Vnc/xstartup

Add a line of gnome-session at the end of the file & (replace # twm &)

# Uncomment the following two lines for normal desktop:
# Unset SESSION_MANAGER
# Exec/etc/X11/xinit/xinitrc


[-X/etc/vnc/xstartup] & exec/etc/vnc/xstartup
[-R $ HOME/. Xresources] & xrdb $ HOME/. Xresources
Xsetroot-solid gray
Vncconfig-iconic &
X-terminal-emulator-geometry 80x24 + 10 + 10-ls-title "$ VNCDESKTOP Desktop "&
X-window-manager &
# Twn & <----------- comment out, if any
Gnome-session & <-------------- add this line

Method 2: replace it with/etc/X11/Xsession ~ /. Vnc/xstartup

$ Cp/etc/X11/Xsession ~. /. Vnc/xstartup

4. log on to the desktop with VncViewer in windows.

Enter the VNC Server address in the following format: VNCServer ip Address: session number (for example, if my ubuntu ip address is 192.168.1.103 and the session number is 2, enter 192.168.1.103: 2)

Connect, and then enter the password set above. OK. Now the remote connection is successful.

5. Disable desktop sessions

$ Vncserver-kill session number (for example, $ vncserver-kill 2)

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.