服务器系统 Ubuntu Server 16.04 64bit
1 安装 vnc server:
apt-get update
apt-get install vnc4server
2 安装图形界面:
apt-get install xfce4
3 运行一下 vnc 然后 kill 掉
vncserver :1
vncserver -kill :1
这时候需要你输入一个8位数的密码,这个密码你需要记住,这个是你以后远程连接要用到的。
运行一下就 kill 掉的原因是为了生成配置文件
4 修改配置文件
vim ~/.vnc/xstartup
如文件中所言,将 # Uncomment the following two lines for normal desktop
下面两句的注释取消即可
5 再次启动 vnc
vncserver :1
6 下载 vnc 客户端
https://www.realvnc.com/en/connect/download/viewer/
选择你系统对应的版本即可
7 使用 vnc 客户端
打开已安装的客户端
在上方地址栏输入服务器的IP地址 + :1
,如服务器为 123.12.13.14
,那么就输入 123.12.13.14:1
。
:1
是启动 vnc server 时的参数,如果使用 vncserver :2
启动,那么这里也相应的改成 :2
即可。
8 成功连接
按提示输入密码即可成功连接。
但是会发现好像没有默认的浏览器。
9 安装个 chrome
wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/apt/sources.list.d/
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
apt-get update
apt-get install google-chrome-stable
如果一切顺利安装完成,启动 chrome
/usr/bin/google-chrome-stable
如果提示 Running as root without --no-sandbox is not supported
那么在后面加上 --no-sandbox
即可
/usr/bin/google-chrome-stable --no-sandbox
ps: 发现中文无法正常显示,这个怎么处理,下回分解。