Loongnix-server中vncserver服务使用方法

18 篇文章 4 订阅

一、安装vnc服务端

yum -y install tigervnc-server tigervnc

安装mate相关软件

yum install -y mate-panel mate-settings-daemon metacity nautilus

注意:如果不安装,vnc客户端看不到图标

设置vnc登陆密码

[root@localhost ovirt-engine-la]# vncpasswd 
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used

注意:不设置密码后边使用时会出错

配置服务端

[root@localhost ovirt-engine-la]# cat ~/.vnc/xstartup
#!/bin/sh
#启动桌面
mate-session &
#启动桌面工具
mate-panel &
#nautilus &

注意:不设置vnc客户端连接时可能是黑屏,或者看不到任务栏

开启vnc服务(端口可自定义)

[root@localhost ovirt-engine-la]# vncserver :2

WARNING: vncserver has been replaced by a systemd unit and is about to be removed in future releases.
Please read /usr/share/doc/tigervnc/HOWTO.md for more information.

New 'localhost.localdomain:2 (root)' desktop is localhost.localdomain:2

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:2.log

查看vnc开启的端口

[root@localhost ovirt-engine-la]# netstat -ntlp | grep vnc
tcp        0      0 0.0.0.0:5902            0.0.0.0:*               LISTEN      2123489/Xvnc        
tcp6       0      0 :::5902                 :::*                    LISTEN      2123489/Xvnc   

为vnc开启的端口配置防火墙规则

#添加
firewall-cmd --zone=public --add-port=5902/tcp --permanent  #(--permanent永久生效,没有此参数重启后失效)
#重新载入
firewall-cmd --reload
#查看
firewall-cmd --zone=public --query-port=5902/tcp

二、客户端配置

sudo apt install tigervnc-viewer

注意:本次客户端使用的是基于debian的loongnix操作系统
如果使用的是基于centos的server系统,安装方式为sudo yum install tigervnc

开启客户端并登陆

在这里插入图片描述

链接密码为刚才设置的vnc密码

在这里插入图片描述

登陆后显示如下

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值