首页 > 系统服务 > 详细

ubuntu界面在mac os可视化、显示ubuntu的GUI到本地

时间:2021-04-18 14:34:42      阅读:18      评论:0      收藏:0      [点我收藏+]

本文提供两种方法实现在MacOS上的Ubuntu GUI(图形界面)显示。

方法一功能更加强大,但是界面相对卡顿一些,适合检查性操作,比如刚入门的小白还不太习惯通过命令终端去执行操作,就可以用这种方法作为辅助。

方法二更加轻量,可以实现服务器端单个应用的GUI到主机上的映射(比如打开jupyter notebook、pycharm),对GUI界面操作时很流畅。

方法一:借助VNC软件

可以实现整个Ubuntu系统界面的显示,具体请参考:博客中VNC部分。

方法二:借助X11(XQuartz)

step1:配置远程服务器

安装服务器上的X11

sudo apt-get install xorg
sudo apt-get install openbox

取消ssh_config文件中ForwardX11 yes的注释

sudo vim /etc/ssh/ssh_config
Host *
#   ForwardAgent no
	  ForwardX11 yes
#   ForwardX11Trusted yes
#   RhostsRSAAuthentication no

保存退出,并重启服务器的ssh服务

sudo /etc/init.d/ssh restart

step2:配置本机(MacOS)

安装XQuartz

安装完成后,同样对ssh_config进行修改。

sudo vim /etc/ssh/ssh_config

修改如下(仅修改这部分就可,别都改了):

# Host *
#   ForwardAgent no
#   ForwardX11 yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   IdentityFile ~/.ssh/id_ecdsa
#   IdentityFile ~/.ssh/id_ed25519
#   Port 22
#   Protocol 2
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h

Host *
        SendEnv LANG LC_*
        ForwardX11 yes

step3:测试

登陆服务器

ssh -X username@host

cd到pycharm的bin目录,输入

./pycharm.sh  # 启动pycharm

截图效果如下(不知为何截图后成了这样):技术分享图片

实际效果:

技术分享图片

参考:

1.怎么样用TeamViewer和VNC从远程控制电脑

2.远程服务器的GUI显示到本地及Pycharm配置

ubuntu端pycharm永久激活

自取: https://pan.baidu.com/s/166DQ_BHmF5PWfAyjbBhJjA 密码: apac

ubuntu界面在mac os可视化、显示ubuntu的GUI到本地

原文:https://www.cnblogs.com/Allen-mat/p/14673216.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!