From dc4d5f893eeae2d106a97b8a6d69921de3090066 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Sat, 19 Aug 2023 06:55:15 +0300 Subject: [PATCH] update --- docs/msd.md | 100 +++++++++++++++++++++------------------------- docs/tailscale.md | 16 +++++--- 2 files changed, 57 insertions(+), 59 deletions(-) diff --git a/docs/msd.md b/docs/msd.md index 1e863af..78829ee 100644 --- a/docs/msd.md +++ b/docs/msd.md @@ -1,87 +1,86 @@ # Mass Storage Drive -## Basics - -This is a feature available on PiKVM v2+ that allows you to emulate a CD-ROM or Flash Drive. - -There are some subtleties that you should know: +This is an important feature that is available on all PiKVM V2+ devices. +It is provides possibility to emulate a CD-ROM or Flash Drive to connect removable media +to the target host which will be available evein in BIOS/UEFI if you need live disk +to revive the OS or even reinstall it. !!! info "The size of the CD-ROM image is limited to 2.2 GB" - This is a [limitation](https://github.com/pikvm/pikvm/issues/322) of the Linux kernel, which currently cannot emulate a DVD. - To use a larger boot image, use Flash emulation. If this is not possible (the image does not support Flash, for example, for Windows), - use [this](#create-a-windows-based-flash-disk-image) recipe. + This is a Linux kernel [limitation](https://github.com/pikvm/pikvm/issues/322) on PiKVM, + which currently cannot emulate a DVD drive. + To use a larger boot image, please use a Flash Drive emulation. + If this is not possible (the image does not support Flash, for example, for Windows), + you can try [this recipe](#create-a-windows-based-flash-disk-image). !!! info "Changing the media type between CD-ROM and Flash is possible only when the device is reconnected" - For PiKVM v3 HAT, this can be done using the switch `System -> Connect main USB`. - In this case, the **media type is determined at the time of connecting the image, and not by clicking on the switch**. - The switch affects the settings of the future connection. For non-v3 devices, - you need to either reboot your server or otherwise reinitialize the connection. + For PiKVM V3, this can be done using the `System -> Connect main USB` switch. ------ -## Upload images manually (without Web UI) + In this case, the **media type is determined at the time of connecting the image, and not by clicking on the switch**. -!!! info "This instruction is relevant for KVM >= 3.203. If you are using a previous version, then update OS." + The switch affects the settings of the future connection. For non-V3/V4 devices, + you need to either reboot your target host or otherwise reinitialize the drive. -1. Remount internal storage to rw (read-write): +!!! warning "Legacy note" + This document is relevant for `KVMD >= 3.249`. If you are using an older version, please update the PiKVM OS. - ``` - # kvmd-helper-otgmsd-remount rw - ``` -2. Upload the .ISO image(s) to `/var/lib/kvmd/msd` via scp or similar. +----- +## Manual image uploading without Web UI -3. Create an empty file in `/var/lib/kvmd/msd` with the exact name (case sensitive!) of the uploaded image + prefix `.__` and suffix `.complete`. This will indicate PiKVM that the uploaded image is okay and can be used. For example: +1. Remount internal storage to read-write mode: ``` - /var/lib/kvmd/msd/.__ubuntu-18.04.4-desktop-amd64.iso.complete - + [root@pikvm ~]# kvmd-helper-otgmsd-remount rw ``` -4. Remount internal storage back to ro (read-only): +2. Upload the image(s) to `/var/lib/kvmd/msd` using `scp` or some other tool. + +3. Remount internal storage back to safe read-only mode: ``` - # kvmd-helper-otgmsd-remount ro + [root@pikvm ~]# kvmd-helper-otgmsd-remount ro ``` ----- ## NFS storage -!!! info "This instruction is relevant for KVM >= 3.206. If you are using a previous version, then update OS." - It is possible to create a shared image storage for an entire fleet of PiKVMs using [NFS](https://en.wikipedia.org/wiki/Network_File_System). +!!! note + Configuring an NFS server is beyond the scope of this guide. + If you have some shares, you can easily connect them to PiKVM by creating mount points and adding relevant records to `/etc/fstab`. At the same time, you will be able to upload images via PiKVM Web UI to NFS, and still use local storage. -``` -# rw -# pacman -Syu -# pacman -S nfs-utils -# kvmd-helper-otgmsd-remount rw -# mkdir -p /var/lib/kvmd/msd/NFS_Primary -# mkdir -p /var/lib/kvmd/msd/NFS_Secondary -# kvmd-helper-otgmsd-remount ro -``` +1. Make some preparations: -Edit fstab: + ``` + [root@pikvm ~]# rw + [root@pikvm ~]# pacman -Syu + [root@pikvm ~]# pacman -S nfs-utils + [root@pikvm ~]# kvmd-helper-otgmsd-remount rw + [root@pikvm ~]# mkdir -p /var/lib/kvmd/msd/NFS_Primary + [root@pikvm ~]# mkdir -p /var/lib/kvmd/msd/NFS_Secondary + [root@pikvm ~]# kvmd-helper-otgmsd-remount ro + ``` -```fstab -server:/srv/nfs/NFS_Primary /var/lib/kvmd/msd/NFS_Primary nfs vers=3,timeo=1,retrans=1,soft,nolock 0 0 -server:/srv/nfs/NFS_Secondary /var/lib/kvmd/msd/NFS_Secondary nfs vers=3,timeo=1,retrans=1,soft,nolock 0 0 -``` +2. Add NFS shares to `/etc/fstab`: + + ```fstab + server:/srv/nfs/NFS_Primary /var/lib/kvmd/msd/NFS_Primary nfs vers=3,timeo=1,retrans=1,soft,nolock 0 0 + server:/srv/nfs/NFS_Secondary /var/lib/kvmd/msd/NFS_Secondary nfs vers=3,timeo=1,retrans=1,soft,nolock 0 0 + ``` -And perform `reboot`. +3. Perform `reboot` to apply all changes. -Make sure that the `kvmd` user has read access rights from these directories. You can also give write access if needed. +Make sure that the `kvmd` user has the *read* access from these directories. You can also give the *write* access if needed. For the best performance, it is required to ensure reliable connectivity with NFS server and use minimum `timeo` and `retrans` values. **Using the `soft` option is mandatory, `nolock` is recommended.** Note if an image is added to the NFS storage from the outside, PiKVM will not be able to track this event, so it is required to use `Drive -> Reset` in the Web UI to update the list of images. -Configuring an NFS server is beyond the scope of this guide. - ----- ## Multiple and writable drives @@ -141,7 +140,7 @@ to the server and download some files from to PiKVM from it. After that you will have access to the flash drive from the target server. **Drive 0 represents a drive that is controlled via a web interface and API. Don't use it with kvmd-otgmsd if you don't know exactly what you're doing.** -4. View the driver state: +4. View the drive state: ``` # kvmd-otgmsd -i 1 @@ -232,11 +231,10 @@ Once you have the desired USB stick perform the following on the RPi to create t 4458545152 bytes (4.5 GB, 4.2 GiB) copied, 736.213 s, 6.1 MB/s ``` -4. Correct ownership of new image and make sure the website reports the file as complete (pay attention to the different folder). +4. Correct ownership of new image and make sure the website reports the file as complete. ``` # chown kvmd:kvmd /var/lib/kvmd/msd/windows10-2004.bin - # touch /var/lib/kvmd/msd/.__windows10-2004.bin.complete ``` 5. Remount msd folder as read only @@ -321,10 +319,4 @@ ssh into the Ubuntu system (Or whatever OS you are using) # scp ventoy.img root@pikvm:/var/lib/kvmd/msd ``` -* On PiKVM - -``` -# touch /var/lib/kvmd/msd/.__ventoy.img.complete -``` - * Mount `ventoy.img` as normal flash and select the PiKVM boot device, it should popup with the VenToy logo with the window.iso as a selection diff --git a/docs/tailscale.md b/docs/tailscale.md index 8d1617d..b4cabf2 100644 --- a/docs/tailscale.md +++ b/docs/tailscale.md @@ -23,9 +23,17 @@ any other setting or functionality needs to be redirected to the [Tailscale supp 2. Follow the link to authorize this installation. -3. After success, perform soft reboot using the `reboot` command to make sure that everything is working correctly. +3. After success, perform soft reboot to make sure that everything is working correctly: -4. Perform the command `ip addr show tailscale0` to view the Tailscale IP address. + ``` + [root@pikvm ~]# reboot + ``` + +4. Now you can try to view the IP address of Tailscale network interface: + + ``` + [root@pikvm ~]# ip addr show tailscale0 + ``` If everything is successful, PiKVM will become a member of your VPN network. @@ -49,9 +57,7 @@ If everything is successful, PiKVM will become a member of your VPN network. ----- ## Troubleshooting -If something not work, the usual advice is to completely remove the Tailscale from PiKVM and perform a clean installation. - -To remove Tailscale follow this: +If something not work, the usual advice is to completely remove the Tailscale from PiKVM and perform a clean installation: ``` [root@pikvm ~]# rw