- 先确定自身系统为Ubuntu16.04
wsm@wsm-virtual-machine:~$ cat /etc/issue
Ubuntu 16.04 LTS \n \l
- 使用apt-cache search命令查看选择安装的包
wsm@wsm-virtual-machine:~$ sudo apt-cache search vncserver
[sudo] wsm 的密码:
libvncclient1 - API to write one's own VNC server - client library
libvncclient1-dbg - debugging symbols for libvncclient
libvncserver-config - API to write one's own VNC server - library utility
libvncserver-dev - API to write one's own VNC server - development files
libvncserver1 - API to write one's own VNC server
libvncserver1-dbg - debugging symbols for libvncserver
tightvncserver - virtual network computing server software
vnc4server - Virtual network computing server software #选用vnc4server安装
xtightvncviewer - virtual network computing client software for X
xvnc4viewer - Virtual network computing client software for X
tightvnc-java - TightVNC java applet and command line program
- 执行安装命令
wsm@wsm-virtual-machine:~$ sudo apt-get install vnc4server
- 输入vncserver启动服务,首次启动需要输入密码
root@wsm-virtual-machine:/home/wsm# vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth: file /root/.Xauthority does not exist
New 'wsm-virtual-machine:2 (root)' desktop is wsm-virtual-machine:2
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/wsm-virtual-machine:2.log
服务启动后会生成配置文件/root/.vnc/xstartup,编辑该配置文件并替换原文件内容为下面的内容
vi /root/.vnc/xstartup
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
- 安装gnome执行以下命令
sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
-
reboot重启系统后开启vncserver,在客户端使用5901端口尝试连接
image.png
网友评论