summaryrefslogtreecommitdiff
path: root/hurd/running/qemu.mdwn
diff options
context:
space:
mode:
Diffstat (limited to 'hurd/running/qemu.mdwn')
-rw-r--r--hurd/running/qemu.mdwn127
1 files changed, 90 insertions, 37 deletions
diff --git a/hurd/running/qemu.mdwn b/hurd/running/qemu.mdwn
index 369ceab6..c56292c8 100644
--- a/hurd/running/qemu.mdwn
+++ b/hurd/running/qemu.mdwn
@@ -1,6 +1,3 @@
-[[!meta copyright="Copyright © 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
-2013, 2014, 2016 Free Software Foundation, Inc."]]
-
[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
id="license" text="Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.2 or
@@ -9,6 +6,8 @@ Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
is included in the section entitled [[GNU Free Documentation
License|/fdl]]."]]"""]]
+[[!meta title="QEMU Image"]]
+
This page discusses things for [[Unix]] systems, there is a separate page for
[[Microsoft_Windows]] systems.
@@ -16,15 +15,70 @@ See the discussion about [[hurd/running/qemu/writeback_caching]].
[[!toc]]
+---
# Readily Available Images
-You can use the following images to give the GNU/Hurd a try.
+You can use the following images to give the Hurd a try.
## Debian GNU/Hurd
[[!inline pages=hurd/running/debian/qemu_image raw=yes feeds=no]]
-## [[Nix]]
+#### Trying out rumpdisk
+
+[[Rump kernels|hurd/rump]] provide new modern drivers for the Hurd.
+We refer to rumpdisk as a rump kernel that provides drivers for modern
+hard drives, SSDs, etc. The Rump kernels' integration into the Hurd
+are still somewhat experimental, but they seem to work fairly well on
+bleeding edge Debian.
+
+Once you have your latest qemu Debian GNU/Hurd image running, then you
+can try the rumpdisk (be sure to pass "-m 2GB" or more). First,
+add these sources to your /etc/apt/sources.list
+
+ 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
+
+Then, upgrade to the bleeding edge Debian GNU/Hurd:
+
+ # apt update
+ # apt upgrade --without-new-pkgs
+ # apt dist-upgrade
+
+Now test to see if the rump kernel works before you make the change
+permanent. Manually tweak your /boot/grub/grub.cfg like so:
+
+ # multiboot /boot/gnumach-1.8-486.gz root=part:2:device:hd0 console=com0
+ multiboot /boot/gnumach-1.8-486.gz root=part:2:device:wd0 console=com0 noide
+
+and your /etc/fstab
+
+ #/dev/hd0s2 / ext2 defaults 0 1
+ /dev/wd0s2 / ext2 defaults 0 1
+ #/dev/hd0s1 none swap sw 0 0
+ /dev/wd0s1 none swap sw 0 0
+ #/dev/hd2 /media/cdrom0 iso9660 noauto 0 0
+ /dev/wd2 /media/cdrom0 iso9660 noauto 0 0
+
+Now you can poweroff your machine, reboot, and start using the
+rumpdisk! You can make these changes permanent by tweaking
+/etc/default/grub and telling it to use rumpdisk:
+
+ GRUB_CMDLINE_GNUMACH="noide"
+
+Then update your grub:
+
+ # update-grub
+
+Check that "noide" does appear in your /boot/grub/grub.cfg.
+
+
+## Arch Hurd Live CD
+
+[[!inline pages=hurd/running/live_cd raw=yes feeds=no]]
+
+## [[NixOS and GuixSD|Nix]]
## Unofficial Images
@@ -38,18 +92,17 @@ volunteers and may not have been tested extensively.
with it, please have a look at [[its_wikipage|hurd/running/qemu/babhurd_image]]. And when
you use it, please [tell me your experience with it](http://draketo.de/contact)! - [[community/weblogs/ArneBab]]
-# Arch Hurd Live CD
-Also you can use QEMU to easily try one of the
-[[Hurd_LiveCDs|hurd/running/live_cd/]].
+---
# What is Needed to create a QEMU image
## Debian Installer
-Instructions for creating a qemu image from the install CDs from debian installer can be found in the README alongside the d-i Hurd images: <http://people.debian.org/~sthibault/hurd-i386/installer/cdimage/>
+Instructions for creating a qemu image from the install CDs from debian installer can be found in the README alongside the d-i Hurd images: <https://cdimage.debian.org/cdimage/ports/latest/hurd-i386/>
+---
# KVM acceleration
Check if your CPU supports kvm:
@@ -57,7 +110,7 @@ Check if your CPU supports kvm:
$ egrep '^flags.*(vmx|svm)' /proc/cpuinfo
#### If you don't have hardware support (slow):
- $ apt-get install qemu
+ $ apt install qemu
Do not enable kernel-kqemu, as that assumes some particular behavior from the guest kernel, which we are reluctant to artificially add to gnumach.
@@ -65,7 +118,7 @@ If QEMU with KVM is not available, [[Virtualbox]] reportedly has better
performance.
#### If you have hardware support (recommended):
- $ apt-get install qemu-kvm
+ $ apt install qemu-kvm
$ modprobe kvm
Intel VTx/VTd: Enable Intel kvm in the BIOS
@@ -97,6 +150,7 @@ More info on kvm at: http://www.linux-kvm.org/page/FAQ
If your machine supports hardware acceleration, you should really use the kvm variant of qemu, as it speeds things quite a lot.
+---
# HAP/EPT/NPT acceleration
Performance will be yet better if HAP (EPT or NPT) is available:
@@ -104,6 +158,7 @@ Performance will be yet better if HAP (EPT or NPT) is available:
$ grep ept /proc/cpuinfo
$ grep npt /proc/cpuinfo
+---
# Installing Debian/Hurd with QEMU using the Debian installer
Note: If you have hardware support, replace the qemu commands below with kvm, e.g. qemu-ing -> kvm-img.
@@ -114,7 +169,7 @@ First off you will need to create a disk image using `qemu-img`. I have set mine
Next you will want to start up QEMU and begin the installation process.
- $ qemu -m 1G -drive cache=writeback,file=hd0.img -cdrom debian-7.0-hurd-i386-NETINST-1.iso -net nic,model=rtl8139 -net user
+ $ qemu -m 1G -drive cache=writeback,file=hd0.img -cdrom debian-7.0-hurd-i386-NETINST-1.iso -net nic,model=e1000 -net user
Now at his point do the regular install using `hd0` as your harddrive. Partition it and install the base system.
@@ -162,7 +217,7 @@ Once you have finished installing the base system (might take some time) the sys
Starting qemu/qemu-kvm:
- $ kvm -m 1G -net nic -net user,hostfwd=tcp::5555-:22 -drive cache=writeback,file=hd0.img -vga vmware
+ $ kvm -m 1G -net nic,model=e1000 -net user,hostfwd=tcp::5555-:22 -drive cache=writeback,file=hd0.img -vga vmware
vmsvga_value_write: guest runs Linux.
Note: See below on port forwarding in the networking section.
@@ -195,7 +250,7 @@ During the graphical emulation, you can use the following keys:
3 Serial port
<Ctrl><Alt> Toggle mouse and keyboard grab.
-
+---
# Transferring Files
## Mounting Disk Image on Host
@@ -230,7 +285,7 @@ loop-mounting the file systems images. (Also you don't need `root' rights.)
However, note that there is a bug in [[translator/fatfs]]: [[!GNU_Savannah_bug
25961]].
-
+---
# Networking in QEMU
Some further notes about [[networking]] and home hints about
@@ -240,20 +295,20 @@ Some further notes about [[networking]] and home hints about
If you just want to access the internet from within QEMU, you can setup pfinet for QEMU's user-networking:
- # settrans -afgp /servers/socket/2 /hurd/pfinet -i eth0 -a 10.0.2.15 -g 10.0.2.2 -m 255.255.255.0
+ # settrans -afgp /servers/socket/2 /hurd/pfinet -i /dev/eth0 -a 10.0.2.15 -g 10.0.2.2 -m 255.255.255.0
# echo "nameserver 10.0.2.3" > /etc/resolv.conf
If you are on [[Debian GNU/Hurd|debian]], you can even use [[debian/DHCP]].
To get ssh working:
- # apt-get install random-egd openssh-server (Similarly for telnet if preferred)
+ # apt install openssh-server (Similarly for telnet if preferred)
(See also <http://www.nongnu.org/qemu/qemu-doc.html#SEC32>.)
Outgoing internet connections should just work then.
Testing it can be difficult with a minimal installation,
-but `apt-get update` should work after you have filled out
+but `apt update` should work after you have filled out
`/etc/apt/sources.list`.
After that you should be able to install other network packages,
but note that `ping` doesn't work with QEMU's user-networking stack.
@@ -261,14 +316,11 @@ but note that `ping` doesn't work with QEMU's user-networking stack.
If you want to connect from the host system to the Hurd system running in QEMU, you can use port forwarding in QEMU or to setup something more advanced, like bridged networking.
-### IRC, freenode, #hurd, 2014-02-12
+#### IRC, freenode, #hurd, 2014-02-12
- <braunr> youpi: also, the problems i had with regard to accessing the
- debian repository were caused by a qemu bug where, in nat mode, qemu is
- unable to handle dns requests if the host dns servers are ipv6 ones
+ <braunr> youpi: also, the problems i had with regard to accessing the debian repository were caused by a qemu bug where, in nat mode, qemu is unable to handle dns requests if the host dns servers are ipv6 ones
<youpi> yes, we've noticed that with a student of mine
- <youpi> you may be interested by a patch we submitted to qemu-devel, that
- adds ipv6 support to -net user :)
+ <youpi> you may be interested by a patch we submitted to qemu-devel, that adds ipv6 support to -net user :)
<braunr> :)
<braunr> for now i directly change resolv.conf
<youpi> braunr: the issue is that you have only ipv6 nameservers, right?
@@ -286,7 +338,7 @@ This is the recommended way to work with a Command Line Interface (CLI) since al
a) with ssh (assuming you have installed openssh-server)
- $ kvm -m 1G -net nic -net user,hostfwd=tcp::5555-:22 -drive cache=writeback,file=hd0.img &
+ $ kvm -m 1G -net nic,model=e1000 -net user,hostfwd=tcp::5555-:22 -drive cache=writeback,file=hd0.img &
Logging in to the running Hurd:
@@ -303,7 +355,7 @@ Copying files:
b) with telnet (assuming you have installed a telnet server, like telnetd)
- $ kvm -m 1G -net nic -net user,hostfwd=tcp::5556-:23 -drive cache=writeback,file=hurd-install.qemu &
+ $ kvm -m 1G -net nic,model=e1000 -net user,hostfwd=tcp::5556-:23 -drive cache=writeback,file=hurd-install.qemu &
Logging in to the running Hurd:
@@ -344,22 +396,25 @@ Now it is time to start-up your QEMU Hurd system and get networking going in the
**Important:** Remember you may need to use the `-M isapc` or `-isa` flag if using an older version of the gnumach package.
- $ qemu -m 1G -drive cache=writeback,file=hd0.img -cdrom debian-K9-hurd-i386-CD1.iso -fda floppy.img -boot a -net nic -net tap
+ $ qemu -m 1G -drive cache=writeback,file=hd0.img -cdrom debian-K9-hurd-i386-CD1.iso -fda floppy.img -boot a -net nic,model=e1000 -net tap
Once you have logged in as `root` run the `pfinet` translator with values that apply to your network. Think of your QEMU client as another computer in your network.
- # settrans -fgap /servers/socket/2 /hurd/pfinet -i eth0 -a xxx.xxx.xxx.xxx -g xxx.xxx.xxx.xxx -m xxx.xxx.xxx.xxx
+ # settrans -fgap /servers/socket/2 /hurd/pfinet -i /dev/eth0 -a xxx.xxx.xxx.xxx -g xxx.xxx.xxx.xxx -m xxx.xxx.xxx.xxx
That should do it! Do not forget to edit/update `/etc/resolv.conf` to get DNS working.
-# <a name="multiboot">Multiboot</a>
+---
+# Booting Hurd without grub, using qemu's multiboot support
See "Linux/Multiboot boot specific" section on QEMU manpage.
Get the multiboot modules. Either extract them from the disk image, or,
download:
- $ wget http://people.debian.org/~sthibault/hurd-i386/installer/cdimage/current/{gnumach.gz,ext2fs.static,ld.so.1}
+ $ wget https://cdimage.debian.org/cdimage/ports/latest/hurd-i386/gnumach.gz
+ $ wget https://cdimage.debian.org/cdimage/ports/latest/hurd-i386/ext2fs.static
+ $ wget https://cdimage.debian.org/cdimage/ports/latest/hurd-i386/exec.static
Generally, these files need to correspond to the ones in the disk image, so
don't forget to keep them up to date.
@@ -369,18 +424,16 @@ you'll get told: *qemu: linux kernel too old to load a ram disk*.
$ qemu [...] \
> --kernel gnumach \
+ > --append 'root=device:hd0s1' \
> --initrd \
- > 'ext2fs.static --multiboot-command-line=${kernel-command-line} --host-priv-port=${host-port} --device-master-port=${device-port} --exec-server-task=${exec-task} -T typed device:hd0s1 $(task-create) $(task-resume)',\
- > 'ld.so.1 /hurd/exec $(exec-task=task-create)'
+ > 'ext2fs.static --multiboot-command-line=${kernel-command-line} --host-priv-port=${host-port} --device-master-port=${device-port} --exec-server-task=${exec-task} -T typed ${root} $(task-create) $(task-resume)',\
+ > 'exec.static $(exec-task=task-create)'
Note that, contrary to [[GRUB]]'s configuration file, you don't specify
"`argv[0]`" here, and it's fortunate that neither ext2fs nor exec need a comma
on their command line...
-You can also use `--append [...]`, which will show up in `/proc/cmdline`.
-
-Command line above crashes with old qemu versions, for instance qemu 1.1.2 on Debian Wheezy, fixed by upgrading to wheezy-backports currently qemu 1.7.0, see [[!debbug 741873]]
-
+---
# Related Links
These are links that users may find helpful.
@@ -390,4 +443,4 @@ system after installation.
[[Image_for_L4]] -- a QEMU image for the Hurd/L4 project.
-<http://eyeside.net/hurd/Hurd-on-QEMU.html>
+[Hurd Installation Guide from eyeside.net](https://web.archive.org/web/20130516025306/http://www.eyeside.net/index.htm)