【原创脚本】一键安装可以使用浏览器访问的Linux桌面环境

今天,我们来介绍一下我自己写的一个一键shell脚本。使用此脚本,您可以在您的Linux服务器上一键搭建一个可以随时随地用浏览器访问的Linux桌面环境,让您便捷地管理服务器。

本文及脚本程序作者为香菇肥牛,原文链接为https://qing.su/article/oneclick-desktop.html, 转载需注明原文链接。谢谢!

Github项目地址https://github.com/Har-Kuun/OneClickDesktop/ 欢迎大家星星叉叉

1, 脚本特色

  • 从源码编译安装Guacamole服务器
  • 配置Guacamole Web APP
  • 安装Tomcat 9, XRDP/TigerVNC, XFCE4桌面环境,火狐浏览器
  • 一键安装配置Let’s Encrypt安全证书,开启OCSP装订
  • 安装Nginx反代Tomcat
  • 安装完毕后,您可以使用任意浏览器访问远程桌面,无需再使用VNC/RDP客户端

 

2, 安装系统需求

目前,本程序仅支持在Ubuntu 18.04/20.04 LTS以及Debian 10的64位操作系统上运行。您的服务器或者VPS最好是全新安装的系统,不带LAMP/LEMP等组件或cPanel/DirectAdmin/宝塔等用户面板。

本程序支持Ubuntu 18.04/20.04 LTS, Debian 10, 以及CentOS 7/8 64位操作系统上运行。您的服务器或者VPS最好是全新安装的系统。如果您想要和宝塔或者其他面板共存,那么安装时请选择不安装Nginx反代,然后用您的面板来对服务器的http://IP_addr:8080/guacamole这个地址反代。

您的服务器需要有外网IP地址。在安装之前,您需要解析一个域名(可以用三级域名或者一个免费域名)到您的服务器上。如果您使用Debian或者Ubuntu系统,安装桌面环境需要至少1 GB的内存,推荐1.5 GB内存或以上。如果您使用CentOS系统,安装桌面环境需要至少1.5 GB内存,推荐2 GB内存或以上。

 

3, 安装教程

您可以使用sudo权限用户或root用户(不建议)登录服务器SSH,然后执行下面的命令即可。

英文版:

1
wget https://raw.githubusercontent.com/Har-Kuun/OneClickDesktop/master/OneClickDesktop.sh && sudo bash OneClickDesktop.sh

中文版:

1
wget https://raw.githubusercontent.com/Har-Kuun/OneClickDesktop/master/OneClickDesktop_zh-CN.sh && sudo bash OneClickDesktop_zh-CN.sh

程序将自动安装需要的各部分组件,并引导您选择RDP/VNC方式,设置用户名,密码以及域名。

如果安装过程中有报错,您可以检查同目录下的OneClickDesktop.log日志文件。同时建议您在这里留言汇报一下错误信息,或者在Github上提交issue, 这样我就可以即时更新脚本,修复问题。

 

4, 安装示例

安装好后,我们可以可以直接从浏览器里访问服务器上搭建的桌面程序,如下图。

 

综上,使用OneClickDesktop一键脚本,您可以自由方便地在Linux服务器上搭建随时随地用浏览器即可访问的桌面环境,让您便捷地管理您的Linux服务器,无需再使用繁琐的命令行。如果您喜欢此脚本,欢迎给Github项目https://github.com/Har-Kuun/OneClickDesktop/加星星加叉叉,或者把本文分享给朋友们。如果您有任何疑问,也欢迎在这里留言。

本文及脚本程序作者为香菇肥牛,原文链接为https://qing.su/article/oneclick-desktop.html, 转载需注明原文链接。谢谢!

注1:添加中文支持

1, 重新配置系统locales

1
sudo dpkg-reconfigure locales

2, 安装亚洲语言包

1
2
sudo apt-get install language-pack-ja language-pack-zh* language-pack-ko
sudo apt-get install japan* chinese* korean*

3, 安装亚洲语言字体

1
sudo apt-get install fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho fonts-ipafont-gothic fonts-unfonts-core

56 thoughts on “【原创脚本】一键安装可以使用浏览器访问的Linux桌面环境”

    • 可以使用IP地址:8080/guacamole的方式访问页面。
      方便的话可以把日志文件发送给我,帮你看一下。一般情况下,SSL证书安装失败都是因为解析没生效。

      Reply
  1. 安装好的guacamole,除了能通过浏览器访问这台机器的图形化界面。
    应该也可以配置去访问其他远程Windows系统吧?
    因为guacamole本身就是有这个功能的。

    Reply
  2. 安装好了guacamole之后,电脑访问鼠标无法移动,一直在左上角,但是手机访问却可以移动,求解

    Reply
      • 已经好了,确定是反代配置的问题和chrome的问题,没有证书chrome判定为不安全网页,屏蔽部分权限,需要在chrome://flags/#unsafely-treat-insecure-origin-as-secure里面添加访问域名强制解禁权限,或者通过ip地址直接访问一切正常,毕竟我反代只写了一行

        Reply
  3. Screen Size 默认 1280px X 800px
    貌似没有我的 1366px X 768px 大
    左右两边都有黑框
    在那修改 让它 显示和我的一样大 ?

    Reply
    • 这个是在/etc/systemd/system/vncserver@.service这个文件里面设置的哈。修改之后,执行

      1
      2
      systemctl daemon-reload
      systemctl restart vncserver@1.service
      Reply
    • 编辑文件/etc/tomcat9/server.xml, 可以把8080改成别的端口,然后

      1
      systemctl restart tomcat9

      我没用过宝塔,你可以去他们官方论坛里面问一下

      Reply
  4. Greetings! Very helpful advice in this particular article!
    It’s the little changes that produce the most important changes.
    Thanks for sharing! 0mniartist asmr

    Reply
  5. I’ve been browsing online more than 3 hours today, yet I never
    found any interesting article like yours. It’s
    pretty worth enough for me. In my opinion, if all website owners and
    bloggers made good content as you did, the internet will be
    a lot more useful than ever before. asmr 0mniartist

    Reply
  6. Hello There. I found your blog using msn. This is a really well written article.
    I will be sure to bookmark it and come back to read more of your useful information. Thanks for
    the post. I’ll certainly comeback. 0mniartist asmr

    Reply
  7. Hi everyone, it’s my first pay a quick visit at this website, and post is really fruitful in favor of me, keep up posting such
    posts. asmr 0mniartist

    Reply
  8. Hello, everything is going perfectly here and ofcourse every one is sharing information, that’s in fact excellent, keep up writing.
    asmr 0mniartist

    Reply
  9. İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu İzmir oruspu çocuğu

    Reply
  10. Firmaların takipçi satın alma sebeplerinin arkasında prestijlerini artırmak yatıyor. Çok fazla takipçinin olması markanın daha fazla bilindiği imajını yaratsa da marka bilinirliğiniz gerçek anlamda sadece bir sayıdan oluşacaktır. Markaya değer katan gerçek kullanıcılardır.

    Reply
  11. Oh my goodness! Awesome article dude! Thanks, However I am having troubles with your
    RSS. I don’t understand the reason why I can’t subscribe
    to it. Is there anyone else getting similar RSS problems?

    Anyone that knows the solution can you kindly respond?

    Thanks!!

    Reply
  12. Organik kitle elde et! Takipçi satın almak kadar güzel bir şey olabilir mi takipçi satın al etkili Takipçi satın almak kadar güzel bir şey olabilir mi takipçi satın al ucuz gerçek instagram takipçileri!

    Reply
  13. Its like you read my mind! You seem to know a lot about this, like
    you wrote the book in it or something. I think that you could do with some pics
    to drive the message home a little bit, but other than that,
    this is excellent blog. A great read. I will certainly
    be back.

    Reply

Leave a Comment