# This file describes how to install and run GNU/Hurd under Qemu # in Debian GNU/Linux using the Debian Installer. Step 1: Installation of qemu ============================= Check if your CPU supports kvm: egrep '^flags.*(vmx|svm)' /proc/cpuinfo 1) If you don't have hardware support (slow) apt-get install qemu 2) If you have hardware support (recommended) apt-get install qemu-kvm modprobe kvm Intel VTx/VTd: Enable Intel kvm in the BIOS On a HP xw4600 Workstation: F10, Security->System Security Enable VTx and VTd Check that the kvm module is loaded: lsmod|grep kvm kvm_intel 38050 0 kvm 213800 1 kvm_intel /dev/kvm is created: crw-rw----+ 1 root kvm 10, 232 Mar 14 15:02 /dev/kvm Add yourself to the kvm group adduser your_user kvm; logout; login AMD SVM (AMD-V): Enable AMD-V in the BIOS if not enabled. Check that the kvm module is loaded: lsmod|grep kvm kvm_amd 31862 0 kvm 214088 1 kvm_amd More info on kvm at: http://www.linux-kvm.org/page/FAQ Step 2: Installation of Debian GNU/Hurd ======================================= Download mini.iso from: http://people.debian.org/~sthibault/hurd-i386/installer/cdimage/ Instructions in the README file (displayed by accessing the page) If qemu is installed: qemu-img create hurd-install.qemu 4G If qemu-kvm is installed: kvm-img create hurd-install.kvm 4G Formatting 'hurd-install.kvm', fmt=raw size=4294967296 Starting qemu/qemu-kvm: kvm -m 1024 -net nic,model=rtl8139 -net user -hda hurd-install.kvm -cdrom mini-20110308.iso boot order=dc Note: add -no-kvm-irqchip if you have problems with kvm. In the grub2 graphical menu: (make your own changes below) Default install Language: English Country, territory or area: other, Europe, Sweden Locale: United Kingdom - en_GB.UTF-8 Network: ======== Now configured automatically with dhcp Parameters: IP address: 10.0.2.15 Netmask: 255.255.0.0 Gateway: 10.0.2.2 Nameserver: 10.0.2.3 Qemu network setup: QEMU VLAN <------> Firewall/DHCP server <-----> Internet | (10.0.2.2) | ----> DNS server (10.0.2.3) | ----> SMB server (10.0.2.4) Hostname: your_hostname Domainname: your_domainname HTTP proxy: add_if_needed Root password: your_root_password New user: full_name Username: abbreviated_name User password: your_user_password Partitioning method: Guided Partitioning /dev/hd0: All files in one partition Installation of the base system takes some time... Software selection: Standard system utilities (SSH server, graphical desktop environment) Install GRUB bootloader on MBR: Yes During reboot the follwing is displayed (reason unknown, would not cause any problems though): /hurd/init: Crashing system; essential task auth died init: notifying ext2fs /dev of shutdown: notifying pfinet ... notifying ext2fs gunzip:device:rd0 of shutdown (reboot after a timeout) After reboot: Choose to boot from hard disk! login: {user,root} passwd: your_passwd The following are as root, unless stated explicitly. If you have problems with the network: Issue settrans -afg /servers/socket/2 /hurd/pfinet -i eth0 10.0.2.15 -a 10.0.2.15 -m 255.255.0.0 -g 10.0.2.3 or dhclient eth0 To get ssh working: apt-get install random-egd openssh-server (Similarly for telnet if preferred) Set up /etc/apt/sources.list: nano /etc/apt/sources.list Add: deb http://ftp..debian.org/debian unstable main deb http://ftp.debian-ports.org/debian unstable main To get the correct timezone: dpkg-reconfigure tzdata To get your locale setting: nano /etc/locale.gen Update with command: locale-gen reboot/halt, see below. Step 3: Running the installed system: ===================================== Starting qemu/qemu-kvm: kvm -m 1024 -net nic,model=rtl8139 -net user,hostfwd=tcp::5555-:22 -hda hurd-install.kvm -vga vmware vmsvga_value_write: guest runs Linux. If you have problems with grub hanging during boot with the vmware vga driver: Disable the graphic boot nano /etc/default/grub uncomment GRUB_TERMINAL=console run /usr/sbin/update-grub A few words about the qemu console: =================================== During the graphical emulation, you can use the following keys: -f Toggle full screen -u Restore the screen's un-scaled dimensions -n Switch to virtual console 'n'. Standard console mappings are: 1 Target system display 2 Monitor 3 Serial port Toggle mouse and keyboard grab. A few words about the Mach console: =================================== This console is very primitive and does not have any scrolling facilities. Use the mach console only for basic work. A few words about the Hurd console: =================================== 1) Hurd console at boot: Enable in /etc/default/hurd-console 2) Hurd console after boot: Log in to the Mach console and run the executable script: hurd-console a) As user: sudo ./hurd-console (add yourself to the sudoers with visudo) b) As root ./hurd-console hurd.-console: console -d vga -d pc_mouse --repeat=mouse -d pc_kbd --repeat=kbd -d generic_speaker -c /dev/vcs -F1-F6: virtual consoles returns to the Mach console -up/down scroll! Note: When switching between consoles, make sure the mouse is grabbed in the qemu console! exit mouse grab: Contacting Hurd from a terminal in your host system: ===================================================== This is the recommended way to work with a CLI since you have all your keyboard and locale settings are preserved. a) with ssh kvm -m 1024 -net nic,model=rtl8139 -net user,hostfwd=tcp::5555-:22 -hda hurd-install.kvm & Contacting the running Hurd: ssh -p5555 localhost Copying files: 1) On your host To Hurd: scp -p -P5555 file localhost: >From Hurd: scp -p -P5555 localhost:file . 2) On Hurd To host: scp -p file {10.0.2.2,your_host_ip}: . >From host: scp -p {10.0.2.2,your_host_ip}:file . b) with telnet kvm -m 1024 -net nic,model=rtl8139 -net user,hostfwd=tcp::5556-:23 -hda hurd-install.qemu & Contacting the running Hurd: telnet localhost 5556 c) With the tap interface, see http://www.bddebian.com:8888/~hurd-web/hurd/running/qemu/ Step 4: Setting up X-windows ============================ apt-get install xorg xserver-xorg-video-vmware Install your choice of window manager: apt-get install wmaker menu rxvt dpkg-reconfigure x11-common Choose Anybody are allowed to start the X server: Root Only or Console Users Only does not work. Create .xinitrc: xrandr -s 1024x768 & exec wmaker Note: Due to a bug xinit cannot shut down the X server Solution: Add the following to your xorg.conf: Section "InputDevice" Identifier "Generic Keyboard" Driver "kbd" ... Option "XkbOptions" "terminate:ctrl_alt_bksp" EndSection Step 5: Running X: ================== As user: sudo startx As root: startx (not recommended) Note: Make sure you are starting X from the Hurd console otherwise X will not work. In the following you are running as user, not root! Changing screen resolution: xrandr -s 1024x768 xrandr -s 1280x1024 Step 6: Exiting X ================= After exit from X the screen is scrambled Rescue: Return to the Mach console: Running ./hurd_console gets back to the previous hurd console session! Step 7: Halting/rebooting ========================= Halting: halt wait for the message: In tight loop: hit ctrl-del-alt to reboot before closing the qemu window. Rebooting: reboot If using the Hurd console, go back to the mach console with before halt/reboot to see the console messages.