Subject: bug#25081: Anybody needs help to set up a qemu VM for GNU/Hurd?

From: Svante Signell <[email-masked]>
Date: Thu, 08 Dec 2016 00:00:06 +0100

Hi, adding emacs-devel to the recipients. I hope you don't mind.

On Wed, 2016-12-07 at 14:36 -0800, Paul Eggert wrote:
> I tried to get a qemu VM running for GNU/Hurd on my platform (Fedora 24 
> x86-64), and did not succeed.
> 
> The instructions in 
> https://people.debian.org/~sthibault/hurd-i386/installer/cdimage/ talk 
> about running "apt-get install qemu-kvm". Obviously this won't work on 
> Fedora. I'm not a big fan of virtualization to be honest, but after 
> messing with it a bit I found that the following Unix shell commands 
> sort-of worked:
> 
> sudo dnf install @virtualization
> 
> qemu-kvm -net user,hostfwd=tcp:127.0.0.1:2222-:22 -net nic -drive 
> file=debian-hurd-20160824.img,cache=writeback -m 1G

I normally use:
qemu-system-x86_64 -enable-kvm -m 2048 -net nic,model=rtl8139 -net
user,hostfwd=tcp::<port>-:22 -drive
cache=writeback,index=0,media=disk,file=<whatever>.img

> The latter command outputs the somewhat scary-looking:
> 
> WARNING: Image format was not specified for 'debian-hurd-20160824.img' 
> and probing guessed raw.
>           Automatically detecting the format is dangerous for raw 
> images, write operations on block 0 will be restricted.
>           Specify the 'raw' format explicitly to remove the restrictions.

This is expected, since qemu does not know exactly in what format the file is
in. Maybe just ignore that warning for now? I (and others) do.

> and gives me a screen where I can log in as root and type the command 
> "password demo" to change the password, and then from another terminal 
> window I can run "ssh demo@localhost -p 2222" to login to GNU/Hurd, and 
> after creating .ssh/authorized_keys with my key, I can run "scp -P 2222 
> emacs.tar.gz demo@localhost:". (This "emacs.tar.gz" was created by 
> running "make dist" followed by "tar cf emacs.tar.gz emacs-26.0.50" on 
> my development machine, in the master branch.) Although all this is 
> obvious if you're a VM expert and like messing with VMs, it's not 
> written down in the instructions.

It might be easier to use the debian tools:
apt-get update
apt-get dist-upgrade
apt-get build-dep emacs24/emacs25
apt-get source emacs24/emacs25
cd emacs24-24.5+1/emacs25-25.1+1
dpkg-buildpackage -b 2>&1 | tee ../build-whatever.log
...

> (Plus, I hate having to type 
> Ctrl-Alt-G all the time while configuring the VM -- that's not 
> documented either.)

Never used that? Ctrl-Alt toggles mouse focus though.

> On GNU/Hurd I tried several ways to configure Emacs. None worked. I made 
> the most progess with this:
> 
> tar xf emacs.tar.gz
> 
> cd emacs-26.0.50
> 
> ./configure --without-x --with-gnutls=no
> 
> This failed as follows:
> 
> checking for library containing tputs... no
> configure: error: The required function 'tputs' was not found in any 
> library.
> The following libraries were tried (in order):
>    libtinfo, libncurses, libterminfo, libtermcap, libcurses
> Please try installing whichever of these libraries is most appropriate
> for your system, together with its header files.
> For example, a libncurses-dev(el) or similar package.
> 
> At this point I gave up. I don't know where to grab GNU/Hurd packages 
> from, and anyway this process is taking more of my time than I would 
> like to spend.

See above.

> Perhaps you could build a GNU/Hurd image that already has all the 
> packages needed to develop programs like Emacs, and then send a complete 
> standalone recipe that will let someone easily reproduce the Emacs 
> problem even if they dislike messing with VMs.

Likewise.

Otherwise, you can git clone or download and build the tarball as you wrote
above. (With the dependencies installed)