Poor Man’s IP-KVM Remote Access

Original link: https://blog.heysh.xyz/2023/05/20/ipkvm_4_poor_man/

pikvm.png

Speaking of DIY IP-KVM, of course it is PiKVM and a series of derivative projects, but for Those who put their money into Ponzi schemes For the poor, RPI4 is far from being inexpensive . In recent days, I dug out the same expensive Phicomm N1 and a 30 yuan video capture card from the trash, and found that it happened to work.

Strong self-management ability

Strong self-management ability

Calling the remote control IP-KVM is too unfriendly for SEO. Whenever I search Google, I always see someone trying to run virtualization (aka KVM) on N1, probably some unrealistic fantasy about 2G memory. Finally, a script to install PiKVM on N1 was found on GitHub: toss-a/pikvm-armbian . However, the description here is also a little bit brief, I will try to be a little more detailed, try my best.

Then, you need to prepare the following things:

  1. One N1;

    My N1 was picked up from the trash, and if it was new, there should be some newer and better options . Note that these options need to be OTG capable.

  2. One USB male-to-male data cable;

    Because the USB port of N1 has OTG function, it can simulate mouse and keyboard by directly connecting to the controlled computer.

  3. One video capture card, with one HDMI cable;

    Because the N1 does not have a USB3.0 interface, the MS2109 chip is sufficient and can run 1080p@30Hz.
    It looks like this:

  4. One piece of U disk;
  5. Some Linux knowledge;
  6. May require:
    1. One USB keyboard;
    2. One USB extension cable;
    3. Ideal Internet environment.

      According to relevant laws, regulations and policies (abbreviated below)

No need to prepare Arduino, BadUSB, USB Rubber Ducky, or other microcontrollers, although I have quite a few in the trash.

Installation system: Armbian (Ubuntu flavor)

This part has already been written by many people. The general steps are downgrade—BalenaEcther image is written to U disk—Armbian is written to EMMC. You can refer to GitHub instructions , other people’s blogs or Bilibili . It should be noted that do not insert the USB flash drive when the original system of the box has not been shut down, the Android system will destroy the file permissions of the USB flash drive.

The Armbian image I use is Armbian_23.05.0_amlogic_s905d_jammy_6.1.27_server_2023.05.13.img.gz , where S905d is the chip used by N1, Jammy is the version number of Ubuntu, and 6.1.27 represents the latest version of the Linux kernel. If you install PiKVM, the Debian series (bullseye) packages are a bit too old.

modify dtb file

Well, when I get here, I will assume: N1 has been flashed into an Ubuntu-flavored Armbian system; connected to the network, wired or wireless; able to input commands-whether it is directly plugged into the keyboard monitor, or through SSH, or directly from Leads out of the circuit board.

In the above Armbian boot file, the default USB mode is Host. In order to simulate mouse, keyboard and other devices, you need to change dr_mode from host to peripheral 1 . Then, we need to recompile the dtb file:

 # 将dtb编译为dts文件dtc -I dtb -O dts -o test.dts /boot/dtb/amlogic/meson-gxl-s905d-phicomm-n1.dtb # 用你喜欢的编辑器打开这个文件vim test.dts

Search for dr_mode in test.dts , look for the first dr_mode = "host"; change it to dr_mode = "peripheral";
The context here is roughly this:
Pay attention to the position of the red letter
The following dr_mode does not need to be modified. Don’t ask me why, this part is beyond my ability. Then recompile dts back, move to /boot/dtb/amlogic/ , and modify the startup item:

 dtc -I dts -O dtb -o n1-test.dtb test.dts sudo mv n1-test.dtb /boot/dtb/amlogic/ sudo vim /boot/uEnv.txt

Change FDT line to FDT=/dtb/amlogic/n1-test.dtb :
Recently, I think carbon.now.sh is pretty good

Then restart the system.

install script

At this point, curl google.com returns 302 or 200 , assuming you can access github and other sites transparently. If it doesn’t work, you can try to install zfl9/ss-tproxy on N1, so that N1 can also assume the function of bypass gateway.

 git clone https://github.com/toss-a/pikvm-armbian.git cd pikvm-armbian ./install.sh

Select N when prompted "Do you want to apply custom patches? [y/n] "

Next, reboot the system, run install.sh again, and shut down.

Connect and start

The USB port near the HDMI port of N1 has been changed to OTG slave mode, plug the dual-male USB cable here, and plug the other end into the controlled computer. At this time, if the video capture card cannot be plugged in, take out the extension cable prepared in advance. The photos below are from here , and the photography skills are insane.

Awesome!

Plug in the power again, visit the IP address of N1 with a casual browser, and ignore the certificate error prompt. The initial user name and password are both admin , don’t forget to change the login password, use sudo kvmd-htpasswd set admin .

Also, thanks to the pikvm project, support [their hardware](( https://pikvm.org/ ) if you have the money!


  1. Ref: README , this one is actually quite clear, better than mine. ↩

This article is transferred from: https://blog.heysh.xyz/2023/05/20/ipkvm_4_poor_man/
This site is only for collection, and the copyright belongs to the original author.