Open junxnone opened 5 years ago
Virtual Network Computing
remote framebuffer protocol
sudo apt install tightvncserver
sudo apt install xfce4 xfce4-goodies
~/.vnc/xstartup
mkdir -p ~/.vnc vi ~/.vnc/xstartup
#!/bin/bash xrdb $HOME/.Xresources startxfce4 &
sudo chmod +x ~/.vnc/xstartup
/etc/vnc/xstartup
sudo mkdir /etc/vnc
#!/bin/sh test x"$SHELL" = x"" && SHELL=/bin/bash test x"$1" = x"" && set -- default unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS vncconfig -iconic & "$SHELL" -l << EOF export XDG_SESSION_TYPE=x11 export GNOME_SHELL_SESSION_MODE=ubuntu dbus-launch --exit-with-session gnome-session --session=ubuntu EOF vncserver -kill $DISPLAY
sudo chmod +x /etc/vnc/xstartup sudo chmod 777 /etc/vnc/xstartup
#!/bin/sh [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
chmod +x ~/.vnc/xstartup
/etc/systemd/system/vncserver@1.service
[Unit] Description=Start TigerVNC server at startup After=syslog.target network.target [Service] Type=simple User=your_username Group=your_username #PAMName=login WorkingDirectory=/home/your_username PIDFile=/home/your_username/.vnc/%H:590%i.pid ExecStartPre=-/bin/sh -c "/usr/bin/vncserver -kill :%i > /dev/null 2>&1" ExecStart=/usr/bin/vncserver -fg -depth 24 -geometry 1920x1080 -localhost no :%i ExecStop=/usr/bin/vncserver -kill :%i [Install] WantedBy=multi-user.target
sudo systemctl daemon-reload sudo systemctl enable vncserver@1.service sudo systemctl start vncserver@1 sudo systemctl status vncserver@1
vncpasswd
vncserver -geometry 1920x1080
ps -ef |grep vnc
vncserver -kill :1
1 是 编号/端口
vncviewer
xxx.xxx.xx.xxx:n
n 从 5901 开始
vi ~/.vnc/xstartup
gnome-session &
VNC Tools
Virtual Network Computing
Linux 远程访问 Desktopremote framebuffer protocol
Ubuntu Install tightvncserver
Desktop Setup
xfce4
~/.vnc/xstartup
Gnome
/etc/vnc/xstartup
~/.vnc/xstartup
/etc/systemd/system/vncserver@1.service
UseCase
设置密码
打开一个server 1920 x 1080
查看启动的 vncserver
Kill VNCServer
Connect
vncviewer
连接 IP:Portxxx.xxx.xx.xxx:n
Issues
显示复选框
vi ~/.vnc/xstartup
gnome-session &
Reference