openEuler 22.03 LTS 配置tigervnc使用xfce图形界面

一 环境准备

# cat /etc/openEuler-release
openEuler release 22.03 LTS

# uname -a
Linux test-aarch64 5.10.0-54.0.0.27.oe1.aarch64 #1 SMP Mon Feb 14 01:47:27 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

# rpm -qa |grep tigervnc-server
tigervnc-server-minimal-1.12.0-2.oe1.aarch64
tigervnc-server-1.12.0-2.oe1.aarch64
tigervnc-server-applet-1.12.0-2.oe1.noarch
tigervnc-server-module-1.12.0-2.oe1.aarch64

二 配置tigervnc-server

修改vncserver-config-defaults , 如果取消localhost ,外部不能访问
 #  vi /etc/tigervnc/vncserver-config-defaults
     
    session=gnome
    securitytypes=vncauth,tlsvnc
    geometry=2000x1200
    # localhost
    alwaysshared

配置vnc用户以及对应的访问端口,:1代表可以通过:1或者5901端口通过root用户进行vnc访问
# vi /etc/tigervnc/vncserver.users
    
    :1=root
    :2=test

登录不同的操作系统用户配置vnc密码
    root用户下的vnc密码
    # vncpasswd
    Password:
    Verify:
    Would you like to enter a view-only password (y/n)? y
    Password:
    Verify:

     
    test用户下的vnc密码
    $ vncpasswd
    Password:
    Verify:
    Would you like to enter a view-only password (y/n)? y
    Password:
    Verify:

配置/root/.vnc/xstartup或者/home/test/.vnc/xstartup

# cat  xstartup

内容如下:

#!/bin/sh

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
#exec /etc/X11/xinit/xinitrc
(sleep 5 && export DISPLAY=:1 &&  xfce4-session) &

复制vncserver@x.service 文件
对应/etc/tigervnc/vncserver.users文件中的端口信息
#  cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
#  cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:2.service
 

配置vnc开机自启服务

#   systemctl enable vncserver@:1
#   systemctl enable vncserver@:2

配置selinux

# getenforce
Disabled

重启服务器

# reboot

启动vnc服务
#   systemctl start vncserver@:1
#   systemctl start vncserver@:2

停止vnc服务

#   systemctl stop vncserver@:1
#   systemctl stop vncserver@:2

查看状态

# systemctl status vncserver@:1.service
● vncserver@:1.service - Remote desktop service (VNC)
     Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2022-02-19 16:15:01 CST; 35min ago
    Process: 902 ExecStart=/usr/libexec/vncsession-start :1 (code=exited, status=0/SUCCESS)
   Main PID: 911 (vncsession)
      Tasks: 0 (limit: 41953)
     Memory: 2.0M
     CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
             ‣ 911 /usr/sbin/vncsession root :1

Feb 19 16:15:00 test-aarch64 systemd[1]: Starting Remote desktop service (VNC)...
Feb 19 16:15:01 test-aarch64 systemd[1]: Started Remote desktop service (VNC).

# systemctl status vncserver@:2.service
● vncserver@:2.service - Remote desktop service (VNC)
     Loaded: loaded (/etc/systemd/system/vncserver@:2.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2022-02-19 16:15:01 CST; 35min ago
    Process: 908 ExecStart=/usr/libexec/vncsession-start :2 (code=exited, status=0/SUCCESS)
   Main PID: 919 (vncsession)
      Tasks: 0 (limit: 41953)
     Memory: 688.0K
     CGroup: /system.slice/system-vncserver.slice/vncserver@:2.service
             ‣ 919 /usr/sbin/vncsession test :2

Feb 19 16:15:00 test-aarch64 systemd[1]: Starting Remote desktop service (VNC)...
Feb 19 16:15:01 test-aarch64 systemd[1]: Started Remote desktop service (VNC).
 

# ps -ef |grep vnc
root         911       1  0 16:14 ?        00:00:00 /usr/sbin/vncsession root :1
root         919       1  0 16:14 ?        00:00:00 /usr/sbin/vncsession test :2
test        1013     919  0 16:15 ?        00:00:00 xinit /etc/X11/xinit/Xsession startxfce4 -- /usr/bin/Xvnc :2 -alwaysshared -geometry 2000x1200 -securitytypes vncauth,tlsvnc -auth /home/test/.Xauthority -desktop test-aarch64:2 (test) -fp catalogue:/etc/X11/fontpath.d -pn -rfbauth /home/test/.vnc/passwd -rfbport 5902
root        1030     911  0 16:15 ?        00:00:00 xinit /etc/X11/xinit/Xsession startxfce4 -- /usr/bin/Xvnc :1 -alwaysshared -geometry 2000x1200 -securitytypes vncauth,tlsvnc -auth /root/.Xauthority -desktop test-aarch64:1 (root) -fp catalogue:/etc/X11/fontpath.d -pn -rfbauth /root/.vnc/passwd -rfbport 5901
root        1085    1030  0 16:15 ?        00:00:00 /usr/bin/Xvnc :1 -alwaysshared -geometry 2000x1200 -securitytypes vncauth,tlsvnc -auth /root/.Xauthority -desktop test-aarch64:1 (root) -fp catalogue:/etc/X11/fontpath.d -pn -rfbauth /root/.vnc/passwd -rfbport 5901
test        1088    1013  0 16:15 ?        00:00:00 /usr/bin/Xvnc :2 -alwaysshared -geometry 2000x1200 -securitytypes vncauth,tlsvnc -auth /home/test/.Xauthority -desktop test-aarch64:2 (test) -fp catalogue:/etc/X11/fontpath.d -pn -rfbauth /home/test/.vnc/passwd -rfbport 5902
root        2263    2203  0 16:16 pts/0    00:00:00 grep --color=auto vnc

三 验证

vncviewer ip:1  root用户vnc访问

vncviewer ip:2  test用户vnc访问

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您可以通过访问以下链接来下载openEuler 22.03 LTS操作系统:https://repo.openeuler.org/openEuler-22.03-LTS-SP1/OS/x86_64/ 这个链接将带您进入openEuler的官方下载页面,您可以选择适合您系统的版本进行下载。 另外,根据引用中的信息,openEuler 22.03-LTS是基于5.10内核构建的,这将为您提供更好的操作系统性能和稳定性。希望这个信息对您有所帮助!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [在OpenEuler 22.03 LTS-SP1上下载yum源并安装tar命令](https://blog.csdn.net/m0_63428773/article/details/130177326)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [openEuler22.03LTS操作系统用pip安装saltstack3003.1所需的文件包](https://download.csdn.net/download/forestqq/87339063)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [国产操作系统安装之openEuler-22.03-LTS](https://blog.csdn.net/WeiHao0240/article/details/126024754)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值