关于ubuntu:ubuntu2004安装vncserver

1.装置桌面环境和VNCServer

apt update
#ubuntu20上没有了vnc4server安装包,能够装置tightvncserver
apt install tightvncserver
#启动vncserver
vncserver

依照启动后的提醒设置vncserver的明码
当初从VNCViewer连贯之后的桌面是一片灰白,还须要配置一下vncserver的环境

2.环境配置

先装置图形所需内容

apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

而后批改xstartup文件

#备份原来的配置文件
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
#编辑新的配置文件
vim ~/.vnc/xstartup

在xstartup中增加以下内容:


#!/bin/sh
 
# Uncomment the following two lines for normal desktop:
export XKL_XMODMAP_DISABLE=1
 unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
unset DBUS_SESSION_BUS_ADDRESS

xsetroot -solid grey
vncconfig -iconic&
gnome-panel &
gnmoe-settings-daemon &
metacity &
nautilus &
gnome-terminal &

设置文档权限

chmod +x ~/.vnc/xstartup

之后再次启动vncserver并通过VNC Viewer连贯

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理