首先安装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

#!/bin/sh

unset SESSION_MANAGER

unset DBUS_SESSION_BUS_ADDRESS

startxfce4 &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

xsetroot -solid grey

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

sudo vncserver -kill :1

sudo chmod +x ~/.vnc/xstartup

创建 VNC Service File

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

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

[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target [Service]
Type=simple
User=root
PAMName=login
PIDFile=/root/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null >&
ExecStart=/usr/bin/vncserver -depth -geometry 1366x768 :%i
ExecStop=/usr/bin/vncserver -kill :%i [Install]
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. 工厂模式的python实现

    #1.什么是工厂模式 #2.工厂模式的分类 ''' 1. 简单工厂模式 2. 工厂方法模式 3. 抽象工厂方法模式 ''' #3.简单工厂模式的python实现 from abc import ABC ...

  2. 0804关于mysql 索引自动优化机制: 索引选择性(Cardinality:索引基数)

    转自http://blog.csdn.net/zheng0518/article/details/50561761 1.两个同样结构的语句一个没有用到索引的问题: 查1到20号的就不用索引,查1到5号 ...

  3. CODEVS——T 2618 核电站问题

    http://codevs.cn/problem/2618/  时间限制: 1 s  空间限制: 32000 KB  题目等级 : 黄金 Gold 题解       题目描述 Description ...

  4. POJ 2831

    次小生成树.求出两点间最短路径的最大权值,再把要加入的边与之比较即可. #include <iostream> #include <cstdio> #include <c ...

  5. [Javascript] Highlights from IO18 Javascript new features

    Latest Javascript features, not supported by all broswers, but can use with babel. # try-catch-final ...

  6. leetcode || 50、Pow(x, n)

    problem: Implement pow(x, n). Hide Tags Math Binary Search 题意:求x的n次幂 thinking: (1)最简单想到的是直观上的数学幂函数求法 ...

  7. UVA 4855 Hyper Box

    You live in the universe X where all the physical laws and constants are different from ours. For ex ...

  8. Binding Enum to ComboBox

    1.添加MarkupExtension public class EnumToSourceExtension : MarkupExtension { private Type _type; publi ...

  9. Oracle 与 MySql 区别

    一.并发性 并发性是oltp数据库最重要的特性,但并发涉及到资源的获取.共享与锁定. mysql:mysql以表级锁为主,对资源锁定的粒度很大,如果一个session对一个表加锁时间过长,会让其他se ...

  10. h5-8 canvas

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...