2
0
mirror of https://github.com/pikvm/pikvm synced 2024-11-16 12:12:57 +00:00
pikvm/pages/flashing_os.md

92 lines
5.7 KiB
Markdown
Raw Normal View History

2020-08-02 01:12:05 +00:00
# Flashing the OS image
Download the appropriate memory card image from https://pikvm.org/download.html. Select it based on the board, platform, and the video capture device you are using. For example: choose **v2-hdmi-rpi4.img.bz2** for Raspberry Pi 4 with HDMI-to-CSI capture bridge.
2021-02-13 18:32:57 +00:00
Note: right now, pre-compiled images are only available for the Raspberry Pi 4 and ZeroW. In all other cases, you will need to build the operating system yourself. But don't worry, it's [very simple](building_os.md).
2020-08-02 01:12:05 +00:00
2020-08-02 02:25:45 +00:00
## Using Linux CLI
2020-08-07 01:58:27 +00:00
Decompress and flash image and follow to the [final steps](#the-final-steps). Be careful when choosing your device path:
2020-11-03 19:19:06 +00:00
```
2020-08-10 22:54:15 +00:00
# bzip2 -d v2-hdmi-rpi4.img.bz2
# dd if=v2-hdmi-rpi4.img of=/dev/mmcblkX
2020-08-02 01:12:05 +00:00
```
## Using balenaEtcher (Linux, MacOS and Windows)
1. Download and install [balenaEtcher](https://www.balena.io/etcher).
2020-08-02 02:25:45 +00:00
2. Even on modern computers it might be faster to first extract the compressed image first. A bug in a balenaEtcher prior to version 1.5.108 caused it to use large amounts of RAM and a tediously slow flashing process. Extract the image using your favorite archive software. If you don't have one that supports .bz2 images (on Windows for example) - [7-Zip](https://www.7-zip.org) is a great (free) choice.<br><br>_Flashing the compressed image directly: ~12 minutes; extracting first (~1 minute on an SSD) and flashing afterwards only takes ~3 minutes._
2020-08-02 01:12:05 +00:00
2020-08-02 02:25:45 +00:00
3. Run Balena Etcher:
2020-08-02 01:14:06 +00:00
2020-08-02 01:12:05 +00:00
<img src="../img/balena-1.png" alt="drawing" height="300"/>
4. Press **Flash from file** and select the image:
2020-08-02 01:14:06 +00:00
2020-08-02 01:12:05 +00:00
<img src="../img/balena-2.png" alt="drawing" height="300"/>
5. Insert the memory card into the card reader. Press **Select target** and choose your memory card:
2020-08-02 01:14:06 +00:00
2020-08-02 01:12:05 +00:00
<img src="../img/balena-3.png" alt="drawing" height="300"/>
2020-08-02 01:14:06 +00:00
2020-08-02 02:25:45 +00:00
6. Press **Flash!** button.
2020-08-02 01:14:06 +00:00
2020-08-02 01:14:49 +00:00
<img src="../img/balena-4.png" alt="drawing" height="300"/>
2020-08-02 01:58:37 +00:00
7. Wait for the process to finish. Get yourself a coffee or do some stretching. :wink: If an error occurs during flashing, repeat the process:
2020-08-02 01:58:37 +00:00
2020-08-02 01:12:05 +00:00
<img src="../img/balena-5.png" alt="drawing" height="300"/>
2020-08-02 02:25:45 +00:00
## The final steps
2021-02-13 18:32:57 +00:00
1. **Important for ZeroW**. In order for your device to connect to Wi-Fi, you will have to tell it which network to use with which password. To do this, mount the first partition of the memory card (FAT32) and edit the `pikvm.txt` file there. Do not remove line `FIRSTBOOT=1`, just add your wifi settings like this:
2021-02-13 18:36:56 +00:00
```
FIRSTBOOT=1
WIFI_ESSID="mynet"
WIFI_PASSWD="p@s$$w0rd"
```
2021-02-13 18:37:58 +00:00
Save, unmount and follow the next step.
2020-08-02 02:25:45 +00:00
2021-02-13 18:32:57 +00:00
2. When the process is complete, pull out the memory card and insert it into the Raspberry Pi. Connect the Raspberry Pi to the power supply. Your device will obtain the IP address via DHCP automatically. <br>:exclamation:Windows users: balenaEtcher will automatically safely remove the memory card. If you are using a Windows version prior to Windows 10 1809 and a different flashing software, you should do the safe remove manually.
2020-08-02 01:12:05 +00:00
2021-02-13 18:32:57 +00:00
3. After power-up, Pi-KVM OS generates unique SSH keys and certificates. Do not turn off the Raspberry Pi until it's fully booted. If you set up Wi-Fi in step 1, it won't be able to connect to the network on the first boot. You need to wait 10 minutes for all the OS preparations to complete, then just restart the device. On the second boot, the Raspberry will connect to the network without any problems.
2020-08-02 01:12:05 +00:00
2021-02-13 18:32:57 +00:00
4. Congratulations! Your Pi-KVM will be available via SSH (`ssh root@<ip-address>` with the password `root` by default) and HTTPS. In most networks you should be able to reach Pi-KVM via any browser with the URL `https://pikvm/`. If that doesn't work you'll need to find the IP address manually in your router and try it via `https://<ip-address>`. The default login username is `admin` with `admin` as the password). For HTTPS a self-signed certificate is used by default. Your browser will give you a warning about an invalid SSL certificate which you can safely ignore.
2020-08-02 01:12:05 +00:00
2021-02-16 22:46:15 +00:00
5. To change the root password use command `passwd` via SSH or webterm. To change Pi-KVM web password use `kvmd-htpasswd set admin`. As indicated on the login screen, you need to use `rw` to make the root filesystem writable before issuing these commands. After making changes, make sure to run the command `ro` to switch the filesystem back to read-only. If you are using a web terminal, use the `su -` command to get root access (enter the root password).
2021-02-13 18:32:57 +00:00
2021-02-20 02:12:05 +00:00
6. ~~After installation, we recommend you to update your operating system:~~ The upstream distribution has broken the wifi driver, so don't do it yet.
2020-11-03 19:19:06 +00:00
```
2020-08-02 01:12:05 +00:00
# rw
# pacman -Syu
# reboot
```
2021-02-13 18:32:57 +00:00
7. Pacman saves all installed packages in a compressed format so that you can roll back to the old version if something goes wrong. After you've updated and made sure everything works, it makes sense to clear the package cache so that it doesn't take up space on the SD card:
2020-11-03 19:18:36 +00:00
```
# rw
# pacman -Sc
2021-02-20 02:11:23 +00:00
# rm -rf /var/cache/pacman/pkg
2020-11-03 19:18:36 +00:00
# ro
```
2021-02-13 18:32:57 +00:00
8. **Important note for HDMI-USB dongle** users only. Because of this, many video capture devices tell the server's video card that the HDMI cable is supposedly disconnected. This may lead to the fact that if you boot the server without an active stream, the server will not detect your capture card. This is easy to fix:
2020-10-30 21:48:29 +00:00
* Switch filesystem to RW-mode:
```
# rw
```
* Edit file `/etc/kvmd/override.yaml` and add these lines:
```yaml
kvmd:
streamer:
forever: true
2020-10-31 04:50:44 +00:00
cmd_append: [--slowdown]
2020-10-30 21:48:29 +00:00
```
2020-10-31 00:47:42 +00:00
* Finish:
2020-10-30 21:48:29 +00:00
```
2020-10-31 00:47:42 +00:00
# ro
2020-10-30 21:50:50 +00:00
# systemctl restart kvmd
2020-10-30 21:48:29 +00:00
```
2020-08-02 01:12:05 +00:00
If you have any problems or questions, contact us using Discord: https://discord.gg/bpmXfz5
2020-09-03 08:27:54 +00:00
Subscribe to our Subreddit to follow news and releases: https://www.reddit.com/r/pikvm