ubuntu20使用tigervnc远程桌面配置记录

一、安装tigervnc

sudo apt install tigervnc-common
sudo apt install tigervnc-standalone-server

二、增加配置文件

安装完后新增配置文件:vim ~/.vnc/xstartup

#!/bin/sh
#Uncomment the following two lines for normal desktop:
#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
#gnome-session --session=gnome-classic &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &
#x-terminal-emulator -geometry 1280x1024+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &

三、设置密码

命令vncpasswd设置密码

walle@WALLE:~$ vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n  //这里选择n

四、启动

walle@WALLE:~$ vncserver -localhost no -geometry 1920x1080 :1
Cleaning stale pidfile '/home/walle/.vnc/WALLE:1.pid'!

You will require a password to access your desktops.
New 'WALLE:1 (walle)' desktop at :1 on machine WALLE

Starting applications specified in /home/walle/.vnc/xstartup
Log file is /home/walle/.vnc/WALLE:1.log

Use xtigervncviewer -SecurityTypes VncAuth,TLSVnc -passwd /home/walle/.vnc/passwd WALLE:1 to connect to the VNC server.

-localhost no 需要加上才能支持远程访问
-geometry 设置远程分辨率
:1 远程绘话号

vncserver -list 可以列出当前的会话列表
vncserver -kill id 可以关掉对应的远程会话
笔记本屏幕一直打开亮着,可以进行以下配置:

sudo vi /etc/systemd/logind.conf
HandleLidSwitch=ignore

五、连接

window可以使用MobaXterm软件连接
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值