linux远程桌面连接 VNC Server

原文链接: https://help.aliyun.com/knowledge_detail/41530.html

更新源

# sudo apt-get update

安装vnc4server

# sudo apt-get install vnc4server

修改vnc远程连接密码

# vncpasswd

编辑vnc4server的配置文件

#!/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 &
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &

启动、关闭服务

# vncserver -kill :1
# vncserver :1

出现错误:

Warning: XXX:N is taken because of /tmp/.X1-lock

解决办法:

# sudo rm /tmp/.X* -rf

使用VNC Viewer远程连接
其中的2代表第2个窗口,和服务开启的编号一致
1
连接成功
2
支持Windows和linux之间复制粘贴
法一:

# vncconfig -nowin&

法二:

# sudo apt install autocutsel
# autocutsel -f

猜你喜欢

转载自blog.csdn.net/zhangxuechao_/article/details/99980438