Linux安装配置 VNC Server

VNC connect官方下载:Download VNC Viewer | VNC® Connect

1、安装图形化界面

(1)查看当前的运行级别和可以安装的group

systemctl get-default
yum grouplist

 注意:

①这里list的结果如下没有“GNOME Desktop”之类的而且下面的语句也执行提示不存在就以为这这个镜像缺少相关的源。当然对于云服务器这个问题还是比较好解决的,例如重装一个centos的系统之类的。

②对于centos7以下版本可能是没有systemctl指令的。装的时候尽量就装类似于centos7.3这样版本的系统可能更好。

然后安装GNOME桌面环境

yum groupinstall "GNOME Desktop" "Graphical Administration Tools"

注意:systemctl is part of new centos7 its not available on centos65。

2、关于VNC Server诸多配置以及验证是否成功启动参见这里(好用)

Linux实例安装VNC Server实现图形化访问 - 笑笑别人 - 博客园

根据上面链接可以知道:

#启动vnc server是如下指令的话
systemctl start vncserver@:1.service

#重启就是如下指令
systemctl restart vncserver@:1.service

注意:

①这里面操作的时候要记得关闭防火墙、或者针对某个端口放开,这个方法上面链接没有体现出来。

如果只打开5901端口大概就这样:

sudo firewall-cmd --add-port=5901/tcp
sudo firewall-cmd --add-port=5901/tcp --permanent

 当然也可以赶紧利索的关闭防火墙:

systemctl stop firewalld.service
systemctl disable firewalld.service

②对于云服务器(或者公网ip)还有一个添加安全组规则的步骤不要忘了,具体来说就是放行TCP的5901端口。注:当然你可以完全暴露,但是不推荐。 关于,腾讯云服务器放行端口、配置安全组网上搜一下就知道咋整了。

对于公网的云服务器这里必须要给予放行,否则是连不上的!!!!!

3、VNC Viewer

vnc viewer确实没什么可说的。值得一提的就是macos版本不能太老,目前较新版本的 VNC Viewer不太支持例如10.13.6版本的MacOs。

(1)就是file→new connection。vnc server处输入ip:port然后连接就好。注:这里的端口vnc server默认监听的就是5901端口。

(2)如果没有问题的话后面会弹出窗口让你输入passwd。这个passwd就是配置VNC Server时候设的passwd;例如,此次测试的云服务就是zs+qq。

  

(3)页面展示出来后可能还需要输入密码,这个其实就是用户密码了。注:和win系统意思一样。

例如对于上述配置其实就是输入vnc server所在机器的root用户的密码。

(4)再往后就是常规的东西了。 

4、Centos安装clion

安装方式也很简单,参见:C/C++-在CentOS7 中安装CLion - 简书

值得注意的是这里肯定是要依赖于桌面环境的。

举个例子对于我的机器实际上是已经安装桌面环境了的。但是我尝试在shell(普通终端软件)上执行./clion.sh出现如下报错。但是通过vnc连接打开桌面通过其终端执行就是能够启动clion软件的。

 

4.1、给安装的clion添加桌面快捷键

(1)通过命令行进入桌面文件夹

cd /home/your_username/Desktop

#对于root用户就是
cd /root/Desktop

(2)新建一个以.desktop为结尾的文件

vim clion.desktop

 注:该文件创建后桌面就有对应的图标了,如下左图。

   

(3)在文件中写入如下内容,点击一下就变成Clion的图标了;如上右图。

[Desktop Entry]

Encoding=UTF-8
Name=Clion
Comment=Clion IDE for C/C++
#注意这里是你启动脚本clion.sh的路径
Exec=/root/mystudy/clion/clion-2021.2.3/bin/clion.sh %u
Icon=/root/mystudy/clion/clion-2021.2.3/bin/clion.svg
Terminal=false
StartupNotify=true
Type=Application
Categories=Application;Development;

其他问题:

1、配置像素

Centos7 GNOME Desktop桌面版-调整屏幕分辨率_Java_qin的博客-CSDN博客

  • 3
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
给我翻译To set up VNC on Debian, you can follow these steps: Install a desktop environment if you haven't already done so. For example, you can install GNOME by running the command sudo apt-get install gnome-core. Install the VNC server software. One popular option is TigerVNC. You can install it by running the command sudo apt-get install tigervnc-standalone-server. Configure the VNC server. You can do this by creating a configuration file in the directory /etc/systemd/system. For example, you can create a file called vncserver@.service with the following contents: 复制 [Unit] Description=Start TigerVNC server at startup After=syslog.target network.target [Service] Type=forking User=%i ExecStart=/usr/bin/vncserver :1 -geometry 1280x800 -depth 24 -dpi 96 ExecStop=/usr/bin/vncserver -kill :1 [Install] WantedBy=multi-user.target This configuration will start the VNC server on display 1 with a resolution of 1280x800, a color depth of 24 bits, and a DPI of 96. You can modify these settings to suit your needs. Enable and start the VNC server. You can do this by running the following commands: 复制 sudo systemctl enable vncserver@:1.service sudo systemctl start vncserver@:1.service This will enable the VNC server to start automatically at boot time, and start the server immediately. Connect to the VNC server. You can use any VNC client software to connect to the server. For example, you can use RealVNC or TightVNC. Just enter the IP address of the Debian machine and the display number (in this case, :1) to connect.
06-11

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

焱齿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值