Skip to content

Commit

Permalink
Merge branch 'main' of github.com:sipeed/sipeed_wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Caize committed Aug 15, 2024
2 parents f1455c1 + 57f793c commit 0c0d929
Show file tree
Hide file tree
Showing 32 changed files with 433 additions and 79 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/hardware/assets/NanoKVM/tailscale/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/hardware/assets/NanoKVM/updating/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/hardware/assets/NanoKVM/updating/ssh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/hardware/assets/NanoKVM/updating/update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 0 additions & 29 deletions docs/hardware/zh/kvm/NanoKVM/4_firmware.md

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ NanoKVM Full 为完整版配置,带精致外壳和完整配件,内置开机

![](./../assets/NanoKVM/1_intro/NanoKVM_2.jpg)


## NanoKVM 软硬件资料

NanoKVM 基于 Sipeed [LicheeRV Nano](https://wiki.sipeed.com/hardware/zh/lichee/RV_Nano/1_intro.html) 核心板搭建,这部分硬件的规格书、原理图、尺寸图等均可在这里找到:[点击这里](http://cn.dl.sipeed.com/shareURL/LICHEE/LicheeRV_Nano)
Expand All @@ -63,9 +62,9 @@ NanoKVM Lite 由 LicheeRV Nano E 和 HDMItoCSI 小板构成,NanoKVM FULL 在 N

NanoKVM 镜像在LicheeRV Nano SDK 和 MaixCDK 基础上构建,可以兼容使用 LicheeRV Nano 的资料,反之LicheeRV Nano 或其他 SG2002 产品无法使用KVM软件。如果您想在 NanoKVM 上构建 HDMI 输入相关应用,请与我们联系,以获得技术支持。

+ [NanoKVM-A 原理图](https://cn.dl.sipeed.com/fileList/KVM/nanoKVM/HDK/02_Schematic/SCH_RV_Nano_KVM_A_30111.pdf)
+ [NanoKVM-B 原理图](https://cn.dl.sipeed.com/fileList/KVM/nanoKVM/HDK/02_Schematic/SCH_HDMI_MIPI_31011.pdf)
+ [NanoKVM 镜像下载](https://github.com/sipeed/NanoKVM/releases/tag/NanoKVM)
+ [NanoKVM-A 原理图](https://dl.sipeed.com/fileList/KVM/nanoKVM/HDK/02_Schematic/SCH_RV_Nano_KVM_A_30111.pdf)
+ [NanoKVM-B 原理图](https://dl.sipeed.com/fileList/KVM/nanoKVM/HDK/02_Schematic/SCH_HDMI_MIPI_31011.pdf)
+ [NanoKVM 镜像下载](https://github.com/sipeed/NanoKVM/releases)

## 购买入口

Expand All @@ -77,7 +76,6 @@ NanoKVM 镜像在LicheeRV Nano SDK 和 MaixCDK 基础上构建,可以兼容使

如果您在使用过程中有任何问题或建议,请通过以下渠道和我们反馈:

+ [Github issues](https://github.com/sipeed/NanoKVM)
+ [Github issues](https://github.com/sipeed/NanoKVM)
+ [MaixHub 论坛](https://maixhub.com/discussion/nanokvm)
+ QQ 交流群: 703230713

123 changes: 123 additions & 0 deletions docs/hardware/zh/kvm/NanoKVM/network/frp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
---
title: frp
keywords: NanoKVM, Remote desktop, Lichee, PiKVM, RISCV, tool
update:
- date: 2024-8-13
version: v0.1
author: xwj
content:
- Release docs
---

> 注意,直接在公网暴露服务十分危险!建议配置 HTTPS 后使用。
想要使用 frp,你需要自己编写配置文件,可以参考 [frp 文档](https://gofrp.org)

这里给出一个示例,实现通过 frp [访问内网的 web 服务](https://gofrp.org/zh-cn/docs/examples/vhost-http/)

## 启动 frps 服务

首先你需要一台带有公网 IP 的服务器,然后在该服务上启动 frps 服务。
这里我们假设该服务器 IP 地址为 `20.190.1.1`。你可以将这个 IP 替换为你自己的公网 IP。

1. 下载 [frp](https://github.com/fatedier/frp/releases/download/v0.59.0/frp_0.59.0_linux_riscv64.tar.gzf) 并解压,解压完成后进入该文件夹:

```bash
wget https://github.com/fatedier/frp/releases/download/v0.59.0/frp_0.59.0_linux_riscv64.tar.gz
tar -xzvf frp_0.59.0_linux_amd64.tar.gz
cd frp_0.59.0_linux_amd64
```

1. 创建配置文件 `frps.yaml`

```yaml
bindPort: 7000
vhostHTTPPort: 8080
```

1. 运行 frps 服务:

```bash
./frps -c frps.yaml
```

## 启动 frpc 服务

1. 通过 SSH 登录到 NanoKVM;
1. 执行 `frpc -v` 查看版本号,如果没有输出,则需要手动安装 frpc;
- 下载 [frp](https://github.com/fatedier/frp/releases/download/v0.59.0/frp_0.59.0_linux_riscv64.tar.gzf) 并解压;
- 将 `frpc` 文件移动到 `/usr/bin/` 目录

1. 创建配置文件 `/etc/kvm/frpc.yaml`

```yaml
serverAddr: 20.190.1.1 # 你的公网 IP
serverPort: 7000
proxies:
- name: nanokvm
type: http
localPort: 80
customDomains:
- 20.190.1.1
```

1. 启动 frpc 服务:

```bash
frpc -c /etc/kvm/frpc.yaml
```

frps 和 frpc 服务都启动后,在浏览器中输入 `20.190.1.1:8080`,就可以在公网中访问到 NanoKVM 了。

## 配置域名

如果你想给 NanoKVM 配置一个域名,可以修改 `frpc.yaml` 文件:

```yaml
serverAddr: 20.190.1.1 # 你的公网 IP
serverPort: 7000
proxies:
- name: nanokvm
type: http
localPort: 80
customDomains:
- www.yourdomain.com # 你的域名
```

然后将域名 [`www.yourdomain.com`](http://www.yourdomain.com) 解析到 `20.190.1.1`

使用浏览器打开 [`http://www.yourdomain.com:8080`](http://www.yourdomain.com:8080/) 即可访问到 `NanoKVM`

## 配置 HTTPS

可参考 frp 文档:[为本地 HTTP 服务启用 HTTPS](https://gofrp.org/zh-cn/docs/examples/https2http/)。

1. 配置 `frps.yaml` 文件:

```yaml
bindPort: 7000
vhostHTTPSPort: 443
```

1. 配置 `frpc.yaml` 文件

```yaml
serverAddr: 20.190.1.1 # 你的公网 IP
serverPort: 7000
proxies:
- name: nanokvm
type: https
customDomains:
- yourdomain.com # 你的域名
plugin:
type: https2http
localAddr: 127.0.0.1:80
crtPath: ./server.crt # 证书路径
keyPath: ./server.key # 私钥路径
hostHeaderRewrite: 127.0.0.1
requestHeaders:
set:
x-from-where: frp
```

1. 分别启动 frps 和 frpc 服务,然后在浏览器中访问 [`https://yourdomain.com`](https://yourdomain.com) 即可
39 changes: 39 additions & 0 deletions docs/hardware/zh/kvm/NanoKVM/network/static_ip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: 静态 IP
keywords: NanoKVM, Remote desktop, Lichee, PiKVM, RISCV, tool
update:
- date: 2024-8-13
version: v0.1
author: xwj
content:
- Release docs
---

NanoKVM 默认通过 DHCP 获取 IP,这意味着 NanoKVM 的 IP 可能会发生变化。

如果你希望始终使用同一个 IP 来访问 NanoKVM,可以给 NanoKVM 设置一个静态 IP。

## 设置静态 IP

在 NanoKVM 中创建文件 `/boot/eth.nodhcp` ,然后按照以下规则进行编辑:

- 一行就是一个自定义 IP,格式为 `addr/netid gw[optional]`
- 可以分多行来预设多个静态 IP。

```bash
# 示例
192.168.0.101/24 192.168.0.1 # addr/netid gw
192.168.3.116/22 # addr/netid
```

编辑并保存该文件后,执行 `/etc/init.d/S30eth restart` 命令使配置文件生效。

**注意**,如果所有预设的静态 IP 地址都被 arp 检测到已占用,则静态 IP 会设置失败。
此时会触发 DHCP 来获取 IP 地址。如果仍然获取失败,则会将 IP 强制设置成 `192.168.90.1/24`

这是为了保证 NanoKVM 总有一个可用的 IP 地址,以便能通过网络来操作 NanoKVM。
如果 NanoKVM 没有分配到可用的 IP 地址,则需要手动修改 TF 卡中的文件,或者重新烧录镜像才能正常使用。

## 取消静态 IP

删除 `/boot/eth.nodhcp` 文件,即可取消静态 IP。NanoKVM 会重新通过 DHCP 来获取 IP。
54 changes: 54 additions & 0 deletions docs/hardware/zh/kvm/NanoKVM/network/tailscale.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Tailscale
keywords: NanoKVM, Remote desktop, Lichee, PiKVM, RISCV, tool
update:
- date: 2024-8-13
version: v0.1
author: xwj
content:
- Release docs
---


> **推荐将 NanoKVM 与 Tailscale 配合使用,来实现公网访问远程主机的目的。**
*注意:v1.0.0 版本的镜像不支持 Tailscale。如果你的 NanoKVM 镜像版本是 v1.0.0,请先[更新镜像](https://wiki.sipeed.com/hardware/zh/kvm/NanoKVM/start/flashing.html)*

目前 NanoKVM 已经内置了 Tailscale,只需要简单的操作即可开始使用。
有两种配置 Tailscale 的方式:在浏览器中配置和在终端中配置。
推荐在浏览器中进行配置。如果你需要更多的自定义功能,也可以在终端中进行配置。

## 在浏览器中配置

1. 在浏览器中输入 NanoKVM 的 IP 并访问;
1. 点击设置 - Tailscale:

![ipconfig](../../../../assets/NanoKVM/tailscale/setting.png)

1. 如果提示 Tailscale 未安装,请点击安装,并等待安装完成。如果显示已安装,则进行下一步:

![ipconfig](../../../../assets/NanoKVM/tailscale/install.png)

1. 点击登录,等待 Tailscale 启动并生成登录链接(该操作只需要执行一次,Tailscale 会开机自启):

![ipconfig](../../../../assets/NanoKVM/tailscale/login.png)

1. 登录链接生成后,浏览器会自动打开该链接。如果未自动跳转,请手动访问生成的链接。然后登录 Tailscale 账号,并点击 `Connect` 将 NanoKVM 加入到你的账号。

![ipconfig](../../../../assets/NanoKVM/tailscale/connect.png)

1. 现在可以在你的 Tailscale 账号下看到 NanoKVM 了。在公网环境中,运行 Tailscale,然后在浏览器中访问 `100.79.236.88 (替换为你的 Tailscale IP)`即可:

![ipconfig](../../../../assets/NanoKVM/tailscale/machines.png)

## 在终端中配置

1. 通过 SSH 登录到 NanoKVM;
2. 执行 `tailscale version` 检查 tailscale 是否已经安装。如果未安装,则手动进行安装:
- 下载 [Tailscale](https://pkgs.tailscale.com/stable/tailscale_latest_riscv64.tgz) 并解压;
-`tailscale` 文件移动到 `/usr/bin/` 目录;
-`tailscaled` 文件移动到 `/usr/sbin/` 目录。
3. 执行 `/etc/init.d/S98tailscaled restart` ,启动 tailscale 服务;
4. 执行 `tailscale login` ,等待登录链接生成,然后在浏览器中访问生成的链接;
5. 在浏览器中点击 `Connect` ,将 NanoKVM 加入到你的 Tailscale 账户;
6. 操作完成!现在就可以通过 Tailscale 访问 NanoKVM 了。
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 快速开始
title: 快速上手
keywords: NanoKVM, Remote desktop, Lichee, PiKVM, RISCV, tool
update:
- date: 2024-7-4
Expand All @@ -15,8 +15,6 @@ update:

Full版包含 NanoKVM(带外壳,带卡)、KVM-B板、USB A to C 线 *2、杜邦线。



Lite版包含 NanoKVM(不带外壳和TF卡) 、散热片。

## 接口介绍
Expand All @@ -43,9 +41,23 @@ NanoKVM-Full版接口示意图如下,Lite版仅包含 USB-C、HDMI和网口,

![](./../assets/NanoKVM/2_unbox/unbox_2.png)

## 基础操作
## 更新

### 更新镜像

> **Lite 版本需要准备 TF 卡并且烧录镜像后才能开始使用!**
Full 版本出厂时已经烧录了镜像,可以跳过此步骤。

### Lite用户烧卡请参考[烧卡方法](https://wiki.sipeed.com/hardware/zh/kvm/NanoKVM/3_firmware.html)
镜像会不定期更新。建议更新到最新版本镜像,以获取更好的使用体验。

具体操作方式请参考 [烧录镜像](https://wiki.sipeed.com/hardware/zh/kvm/NanoKVM/system/flashing.html)

### 更新应用

目前应用还处于快速迭代阶段,使用前请先将应用更新到最新版本。具体操作方式请参考 [更新应用](https://wiki.sipeed.com/hardware/zh/kvm/NanoKVM/system/updating.html)

## 基础操作

### 如何获取IP地址

Expand All @@ -55,9 +67,9 @@ Full版NanoKVM自带OLED显示屏,联网之后会在显示屏第一行显示IP

Lite版用户在插入镜像卡启动后,可在路由器/交换机后台查看IP。用户也可按照[LicheeRV NANO](https://wiki.sipeed.com/hardware/zh/lichee/RV_Nano/5_peripheral.html#usb-rndis-%E7%BD%91%E5%8F%A3)的联网方式登录到板子,使用`ifconfig`查看`eth0`的地址

### 更新应用,查看远程桌面
### 查看远程桌面

浏览器直接输入获取的IP,进入登录页面,默认账号密码为admin、admin,登录后请**先检查更新**(设置 -> 检查更新),详细步骤可参考[应用升级方法](https://wiki.sipeed.com/hardware/zh/kvm/NanoKVM/4_firmware.html)
浏览器直接输入获取的IP,进入登录页面,默认账号密码为admin、admin,登录后请**先检查更新**(设置 -> 检查更新),详细步骤可参考 [更新应用](https://wiki.sipeed.com/hardware/zh/kvm/NanoKVM/system/updating.html)

Lite版用户,或Full用户重新烧卡登录后页面上无远程画面,请先升级应用后刷新网页,即可开始使用

Expand Down
38 changes: 38 additions & 0 deletions docs/hardware/zh/kvm/NanoKVM/system/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: 配置文件
keywords: NanoKVM, Remote desktop, Lichee, PiKVM, RISCV, tool
update:
- date: 2024-8-13
version: v0.1
author: xwj
content:
- Release docs
---


配置文件的路径为 `/etc/kvm/server.yaml`

默认的配置文件内容:

```yaml
protocol: http
port:
http: 80
https: 443
cert:
crt: server.crt
key: server.key
```
- protocol:网络协议,`http` 或 `https`
- port:服务运行的端口
- 当 protocol 为 http 时,服务会使用 port.http 端口
- 当 protocol 为 https 时,服务会使用 port.https 端口
- 当 protocol 为 https 时,在浏览器中访问时需要加上 `https://` 前缀 (例如:`https://192.168.1.210`)
- 如果你修改了端口,在浏览器中访问时请加上该端口。例如修改 port.http 为 8080,则在浏览器中的访问地址为 `192.168.1.210:8080`
- 请勿将端口设置为 0。服务检测到端口为 0 时,会使用默认配置覆盖当前配置文件
- cert:服务证书。如果 protocol 设置为 https,则需要配置该参数
- crt:证书文件的路径
- key:私钥文件的路径

注意,开启 https 后会增加 cpu 占用,可能会导致画面卡顿。
Loading

0 comments on commit 0c0d929

Please sign in to comment.