linux远程桌面连接 VNC Server
更新源
# sudo apt-get update
安装vnc4server
# sudo apt-get install vnc4server
修改vnc远程连接密码
# vncpasswd
编辑vnc4server的配置文件
docker arm64测试
#!/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 &
NVIDIA NX Ubuntu 18.04测试
sudo apt install xfce4 xfce4-goodies vi .vnc/xstartup
#!/bin/bash unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS xrdb $HOME/.Xresources startxfce4 &
启动、关闭服务
# vncserver -kill :1
# vncserver -geometry 1920x1080 :1
出现错误:
Warning: XXX:N is taken because of /tmp/.X1-lock
解决办法:
# sudo rm /tmp/.X* -rf
使用VNC Viewer远程连接
其中的2
代表第2
个窗口,和服务开启的编号一致
连接成功
支持Windows和linux之间复制粘贴法一:
# vncconfig -nowin&
法二:
# sudo apt install autocutsel
# autocutsel -f