Ubuntu vnc4server安装配置

时间:2021-04-12 00:33:06

a) sudo apt-get install vnc4server

 

b) 运行sudo vncserver 生成.vnc/xstartup文件

ps a

sudo kill xxPIDxx

 

c) sudo gedit .vnc/xstartup

 

d) 默认的配置是twm,很简陋!
#!/bin/sh

# 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 grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

 

这个是gnome

gnome-session &


这个是kde

startkde & 
 

d) sudo vncserver

 

New 'hm-desktop:1 (root)' desktop is hm-desktop:1

Starting applications specified in /home/hm/.vnc/xstartup
Log file is /home/hm/.vnc/hm-desktop:1.log

 

e) 在windows下打开vncviewer 输入地址 比如192.168.186.133:1或hm-desktop:1