# X11vnc 與 novnc

### 第一部分：安裝VNC Server

```
 sudo apt-get install x11vnc
```

接著我們需要為VNC Server設定一個密碼檔

```
 x11vnc --storepasswd  
預設位置會存在 ~/.vnc/passwd
```

啟動VNC Server

```
x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth ~/.vnc/passwd -rfbport 5900 -shared
```

### 第二部分：安裝NoVNC&#x20;

再開啟一個終端機(總共有兩個終端機在執行)&#x20;

先安裝git

```
sudo apt install git
```

下載novnc

```
git clone https://github.com/novnc/noVNC.git
```

```
$cd noVNC
$./utils/launch.sh --vnc localhost:5900  
//port：5900要和VNC Server設定的port一致
//NoVNC預設port為6080 

用另一台電腦開啟瀏覽器網址輸入
http://遠端主機IP:6080/vnc.html
會看到NoVNC登入畫面
Password欄位輸入第一部分安裝VNC Server所設定的密碼

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/ubuntu-zhuo-mian/wang-lu-gong-ju/x11vnc-yu-novnc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
