Files
2026-07-17 10:20:54 +08:00

60 lines
1.2 KiB
Markdown
Raw Permalink 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: Linux安装VNC服务端
date: 2023-11-27T09:33:32+08:00
lastmod: 2023-11-27T09:33:32+08:00
draft: false
description: ''
authors:
- Kushidou
tags:
- Linux
- 软件
categories: []
toc: true
comments: true
---
*(笔记)在Linux系统里安装远程桌面VNC客户端并连接。*
<!--more-->
### 1. 安装NVC服务端
```bash
sudo apt install x11vnc
```
### 2. 设置远程连接密码
```bash
x11vnc --storepasswd
# 输入两次连接密码以设定
# 询问 Write password to /home/xxx/.vnc/passwd
# 时,输入y并回车保存密码。
```
* 该步骤不需要使用sudo
### 3. 使VNC服务开机自启动
使用service的方法,将vnc作为一个服务开机启动
创建`/lib/systemd/system/x11vnc.service`文件并填入下面的内容
```ini
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -rfbauth /home/xxx/.vnc/passwd
[Install]
WantedBy=multi-user.target
```
* 注意,/home/xxx 需要替换成实际的用户名!
### 使用vnc客户端连接
我使用Windows上的VncViewer,官网[RealVNC](https://www.realvnc.com/en/),这个软件假冒的很多,下载需要注意甄别。