2026-04-02 23:12:36 +08:00

37 lines
710 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: ubuntu安装图形界面并按需启动
createTime: 2023/06/29 00:28:24
tags:
- ubuntu
categories:
- 随记
---
1. 安装图形界面和 xrdp
```bash
sudo apt install ubuntu-desktop
sudo apt install xrdp
# 开启xrdp端口
sudo ufw allow 3389/tcp
sudo ufw reload
```
2. 将默认启动方式修改为命令行
```bash
sudo systemctl set-default multi-user.target
sudo systemctl disable gdm
sudo systemctl disable xrdp
# 查看默认启动方式
systemctl get-default
# graphical.target是图形界面multi-user.target是多用户命令行界面
```
3. 启动图形界面和 xrdp
```bash
sudo systemctl start gdm # 返回命令行界面需要stop一下
sudo systemctl start xrdp
```