首先安装Xfce4桌面环境。Xfce4是在Unix和Unix-like(Linux, FreeBSD)上运行的开源桌面环境,其特点是快速,轻量,同时拥有美观的交互界面,易于使用。

Xfce4的安装十分简单,运行如下命令即可。

安装Xfce

sudo apt-get install xfce4

安装VNCServer

sudo apt-get install vnc4server

# #注意:我安装的是 vnc4server 而非 tightvncserver 服务。

设置密码并运行vncserver

vncserver

配置xstartup文件

修改xstartup文件内容,针对Xfce4桌面环境.

sudo mv ~/.vnc/xstartup ~/.vnc/xstartup.bak

sudo vim ~/.vnc/xstartup

  1. #!/bin/sh
  2.  
  3. unset SESSION_MANAGER
  4.  
  5. unset DBUS_SESSION_BUS_ADDRESS
  6.  
  7. startxfce4 &
  8.  
  9. [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
  10.  
  11. [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
  12.  
  13. xsetroot -solid grey

修改配置文件后,运行如下命令结束掉之前产生的窗口:1

sudo vncserver -kill :1

sudo chmod +x ~/.vnc/xstartup

创建 VNC Service File

sudo vim /etc/systemd/system/vncserver@.service

注:用户,家目录,分辨率。

  1. [Unit]
  2. Description=Start TightVNC server at startup
  3. After=syslog.target network.target
  4.  
  5. [Service]
  6. Type=simple
  7. User=root
  8. PAMName=login
  9. PIDFile=/root/.vnc/%H:%i.pid
  10. ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null >&
  11. ExecStart=/usr/bin/vncserver -depth -geometry 1366x768 :%i
  12. ExecStop=/usr/bin/vncserver -kill :%i
  13.  
  14. [Install]
  15. WantedBy=multi-user.target

重新加载服务

sudo systemctl daemon-reload

开机启动服务,@1 表示开户 5901 端口。

sudo systemctl enable vncserver@1.service

重启服务

sudo systemctl start vncserver@1.service

查看状态

sudo systemctl status vncserver@1.service

使用VNC客户端工具 VNC Viewer 进行远程连接,如下图:

部分参考地址:

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-16-04

Ubuntu 18.04 安装 Xfce桌面和VNC的方法的更多相关文章

  1. Ubuntu 18.04 安装远程桌面

    原文链接:https://baijiahao.baidu.com/s?id=1619271691270163095&wfr=spider&for=pc 安装 tightvncserve ...

  2. Ubuntu 18.04 安装MySQL

    最近在写东西的时候,需要用到MySQL,在网上查了一下,都说Ubuntu18.04不能安装MySQL5.7.22, 总觉的不可能,所以自己就研究了一下,然后分享给大家 工具/原料   VMware W ...

  3. Ubuntu 18.04 安装博通(Broadcom)无线网卡驱动

    目录 Ubuntu 18.04 安装博通(Broadcom)无线网卡驱动 Package gcc is not configured yet. 解决办法 history history | grep ...

  4. 在Ubuntu 18.04 安装 MySQL 8.0

    在Ubuntu 18.04 安装 MySQL 8.0 ① 登入 mysql 官网,在官网中下载 deb 包,点击该链接,即可下载. https://dev.mysql.com/downloads/re ...

  5. Ubuntu 18.04 安装部署Net Core、Nginx全过程

    Ubuntu 18.04 安装部署Net Core.Nginx全过程 环境配置 Ubuntu 18.04 ,Nginx,.Net Core 2.1, Let's Encrypt 更新系统 sudo a ...

  6. Ubuntu 18.04 安装和常用软件安装

    Ubuntu 18.04 安装 下载 Ubuntu 制作 U 盘启动盘 设置电脑为 U 盘启动 插入 U 盘,重启电脑 按照提示安装 Ubuntu 更新 NVIDIA 显卡和 Broadcom 无线网 ...

  7. Ubuntu 18.04安装MongoDB 4.0(社区版)

    Ubuntu 18.04(虚拟机VirtualBox上),MongoDB 4.0, 听室友说,23点有世界杯决赛呢!可是,孤要写博文的啊!以记录这忙乱的下午和晚间成功安装了一个软件到Linux上.—— ...

  8. 真实机下 ubuntu 18.04 安装GPU +CUDA+cuDNN 以及其版本选择(亲测非常实用)【转】

    本文转载自:https://blog.csdn.net/u010801439/article/details/80483036 ubuntu 18.04 安装GPU +CUDA+cuDNN : 目前, ...

  9. Ubuntu 16.04 安装 Gnome 桌面环境

    个人博客链接:Ubuntu 16.04 安装 Gnome 桌面环境

随机推荐

  1. 强大的jQuery图片查看器插件Viewer.js

    简介 Viewer.js 是一款强大的图片查看器 Viewer.js 有以下特点: 支持移动设备触摸事件 支持响应式 支持放大/缩小 支持旋转(类似微博的图片旋转) 支持水平/垂直翻转 支持图片移动 ...

  2. 微信系列之公众号Token验证

    微信系列之公众号Token验证 pycharm连接线上服务器开发 开发过程笔记 参考资料 python3安装web.py可以选择安装`pip install web.py==0.40.dev0 pyc ...

  3. 【[Offer收割]编程练习赛15 C】过河问题

    [题目链接]:http://hihocoder.com/problemset/problem/1516 [题意] [题解] 状态压缩DP+bfs 这个过河问题能用bfs来搞.涨知识了; 首先; 16个 ...

  4. poj 1523 求割点把一个图分成几个联通部分

    #include<stdio.h> #include<string.h> #define N 1100 struct node { int u,v,next; }bian[N* ...

  5. Docker installation in sles SP2

    Please refer to official site for installation  details :  https://docs.docker.com/install/linux/doc ...

  6. codeforces Round #258(div2) C解题报告

    C. Predict Outcome of the Game time limit per test 2 seconds memory limit per test 256 megabytes inp ...

  7. ZOJ 1654 Place the Robots(最大匹配)

    Robert is a famous engineer. One day he was given a task by his boss. The background of the task was ...

  8. 解题报告 之 HDU5303 Delicious Apples

    解题报告 之 HDU5303 Delicious Apples Description There are n apple trees planted along a cyclic road, whi ...

  9. Hadoop Web项目--Friend Find系统

    项目使用软件:Myeclipse10.0,JDK1.7,Hadoop2.6,MySQL5.6.EasyUI1.3.6.jQuery2.0,Spring4.1.3. Hibernate4.3.1,str ...

  10. c28---const

    // // main.c // const关键字,节省内存空间,放在字符表里面, #include <stdio.h> int main(int argc, const char * ar ...