Running Debian/Hurd in KVM
The main goal of this tutorial is to run a pre-installed image of Debian/Hurd-i386 in KVM, providing SSH connection.
|Some parts of this page is based in Debian GNU/Hurd Configuration.|
- Verify if virtualization is enabled in machine setup.
- Install KVM in Debian (on real machine):
# apt install qemu-kvm
Initially, download and run an image of Debian/Hurd-i386:
$ mkdir ~/debian-hurd $ cd ~/debian-hurd $ wget https://cdimage.debian.org/cdimage/ports/current-hurd-i386/debian-hurd.img.tar.gz $ tar -xvzf debian-hurd.img.tar.gz $ kvm -m 1G -drive file=$(echo debian-hurd*.img),cache=writeback -net nic -net user,hostfwd=tcp:127.0.0.1:2222-:22
In login: type root and press ENTER.
Now is time to set a root password and to create a common user (inside debian-hurd running over KVM):
# passwd # adduser test
Now you are able to enter via SSH. Go to a shell session in your real machine and type:
$ ssh -p 2222 firstname.lastname@example.org
|If you want to release the mouse cursor, press Ctrl + Alt + G|
Updating the system
To update the whole system, firstly you need install the most recent debian-ports-archive-keyring package.
- In a web browser, go to https://packages.debian.org/sid/all/debian-ports-archive-keyring/download
- Copy the address of debian-ports-archive-keyring package (right click over ftp.us.debian.org/debian or other available link and copy the download link address).
- Inside debian-hurd (SSH shell), type:
$ su - # wget <link of debian-ports-archive-keyring package> # apt install ./<name of downloaded package>
See a real example below:
$ su - # wget http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/debian-ports-archive-keyring_2019.11.05_all.deb # apt install ./debian-ports-archive-keyring_2019.11.05_all.deb
|Ignore messages like "N: Download is performed unsandboxed as root as file '/root/debian-ports-archive-keyring_2019.11.05_all.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (1073741837: Permission denied)".|
Using nano, vi or vim, edit /etc/apt/sources.list, remove all lines and put the following content:
deb http://deb.debian.org/debian-ports unstable main deb-src http://deb.debian.org/debian unstable main deb http://deb.debian.org/debian-ports unreleased main
Update the local package list and upgrade the system:
# apt update # apt dist-upgrade
After dist-upgrade, if you want save space, run:
# apt --purge autoremove # apt clean
Now you can use Debian/Hurd-i386.
To see other interesting options, please go to https://www.debian.org/ports/hurd/hurd-install.