Trying to (finally) build stuff

Virtual machines are not an end to themselves. I want to use them to build and test some stuff.

(Real) VM running

Yesterday late, I finally gave up on running my Linux partition in a VM, and figured it would be quicker to just install a regular Linux VM and run that for now. VMware has an option to support recursive virtualization (e.g. run KVM within VMware), so I’ll probably start with that. I have too many things to learn, I can do time-consuming things in parallel with my attempts to boot the Linux partition in a VM.

Setting up the VM was easy. I went with the defaults, which give me 20G of disk and 1G of memory. That seems a bit puny, but hey, “they know what they are doing”, right? In any case, I am in my BTRFS-testing mood these days, so I went ahead.

Building spice-server and Linux

I pulled Linus’s head, currently commit e02003b515e8d95f40f20f213622bb82510873d2 (4. 10-rc2 work).

Time to resolve all the dependencies. I should have written them down as I went. At least openssl-devel and elfutils-libelf-devel. For the second one, the makefile is smart enough to tell me the name of three packages (presumably in three different distribution systems). But I also had to get autoconf and automake and maybe a couple others for spice-server, and Knuth knows what got pulled along the way :-).

Running out of disk space after one hour

Well, that was fast. Clearly, the 20G that VMware provisions by default won’t get very far. Good things is that VMs are easy to resize. Bump that up to 200G,

I did not mention that I tried to setup VMs on my NAS yesterday. Bad idea. Way too slow. My home Wi-Fi is not an enterprise-grade storage network. So back to using a small local disk (I want to make sure I can bring that along with me, and 3Tb laptop disks are cheap these days).

Adding more space in the VM is not dynamic, I apparently need to shut it down. Strange. Installing blivet-gui. Who picks up these names anyway? Another oddity, blivet-gui did not find how to resize the partition on which BTRFS resides. It seems to want to resize the file system.

Installing GParted, where that operation is very easy. Had an issue that it would not launch under Wayland without xhost +. Because root can’t talk to the Wayland session otherwise. I wonder how blivet-gui works around this?

Ended up resizing the filesystem with the command line, because it’s finally easier:

# btrfs filesystem reisize 196g /home

Checking that it worked:

# btrfs filesystem df /home
Label: 'fedora' uuid: 76d07816-4332-48cd-a5f7-c1ab27559fa1
Total devices 1 FS bytes used 22.54GiB
devid 1 size 196.00GiB used 25.02GiB path /dev/sda3

Took a couple of minutes tops. Really neat.

First Linux crash

Well, my choice of Linux kernel to pick was apparently not ideal for VMware. My VM ends up in a reboot loop. OK. Time to activate the serial console in make menuconfig:

Device Drivers
           \--> Character devices
             \--> Serial drivers
               \--> Console on 8250/16550 and compatible serial port

OK, it’s activated by default. Good. Just need to configure a port in the VM, see what happens. Installing grub-customizer to add console=tty0 to the corresponding menu entry (yeah, I know, I should do it by hand).

Well, I still don’t see any message on the console. Here is what my grub configuration looks like:

### BEGIN /etc/grub.d/40_custom_proxy ###
menuentry "Fedora (4.10.0-rc2+) 25 (Workstation Edition)" --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.10.0-rc2+-advanced-76d07816-4332-48cd-a5f7-c1ab27559fa1' {
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  e45ab238-46aa-4b69-9173-1d0bc1968c0b
	  search --no-floppy --fs-uuid --set=root e45ab238-46aa-4b69-9173-1d0bc1968c0b
	linux16 /vmlinuz-4.10.0-rc2+ root=UUID=76d07816-4332-48cd-a5f7-c1ab27559fa1 ro rootflags=subvol=root rhgb quiet console=ttyS0,115200
	initrd16 /initramfs-4.10.0-rc2+.img

Am I passing the console option at the wrong spot? Or is the VMware serial console not working as I think it does? In the configuration, it shows as “Serial port 2”. But I don’t see no serial port 0 or 1. Hmmm, indeed, if I boot in the “good” Linux, I see something in the console by using

echo Test > /dev/ttyS1

But sending something to /dev/ttyS0 does nothing. Changing the grub configuration to use ttyS1. Oh, I forgot to remove the quiet option, duh. Now I see something.

Uh oh, it goes much further than I thought it would, but then dies silently:

[   19.585294] [drm] Fifo max 0x00040000 min 0x00001000 cap 0x0000077f
[   19.588834] [drm] Using command buffers with DMA pool.
[   19.590977] [drm] DX: no.
         Starting dracut initqueue hook...
[  OK  ] Started Show Plymouth Boot Screen.
[  OK  ] Reached target Paths.
[  OK  ] Started Forward Password Requests to Plymouth Directory Watch.
[  OK  ] Reached target Basic System.

Wonder what the GG means? Also, in this configuration, the VM does not reboot, it just stays there.

Removing the “recursive virtualization” and “PMU support” options of VMware, just in case they might be trouble. But no, still the same thing, stops at GG. The GG is not a fluke.

It looks like the system switches to graphical mode. So the problem happens relatively late. Maybe I can ssh into it? I don’t know why the old ALT-F1 to get a console no longer works, that was handy.

Note to self: editing a grub configuration entry at boot time and using Control-X to save does not make it persistent.

Building spice-server

I pulled spice-server from Frediano’s branch I had identified yesterday. There’s an, time to install automake, autoconf, lalala. Need the spice-protocol package. I don’t know how many times I type dnf install daily, I wish there was a dnf install what-i-need.

Hmm, maybe there is an idea for a feature here. Something like a login where dnf would save the packages I usually install, and let me reinstall them on another machine in one commadnd. OK, if I’m asking for this, it can mean only two things: either someone already did it, or I will do it one of these days ;-).

It may be a good idea to duplicate my VM, because I can’t make much progress on the spice-server build while I’m trying to debug the issue with Linux.

Now, missing glib-2.0 and gio-2.0. The first one is easy, but there is no gio in dnf install. What is the package name? Problem with such a short package name is that it matches tons of things in dnf search, e.g. nagios. It looks like it’s called gvfs. Also, I installed glib by mistake, which installs some 1.2, need to uninstall it and specify glib2. Curiously, dnf install glib-2.0 does not work.

It still fails:

  glib2.x86_64 2.50.2-1.fc25

But ./configure in spice-server gives me:

configure: error: Package requirements (glib-2.0 >= 2.28 gio-2.0 >= 2.28) were not met:

No package 'glib-2.0' found
No package 'gio-2.0' found

So I guess I’m getting the wrong one. Ah, forgot the -devel suffix… The devel is in the details ;-). So glib2-devel is enough to get gio-2.0 as well. The next missing dependency is pixman. The next one is celt051. And every time, you need one go through ./configure. Yuck.

There has to be a more efficient way. Firing up emacs to actually read the README and INSTALL files ;-). Which talk about a GE Gui package which I can’t even find with Google. Don’t know what that is. And don’t mention celt051. TODO: Fix it.

After installing all the required dependencies, the build fails.

  GEN      generated_client_demarshallers.c
Makefile:809: recipe for target 'generated_client_demarshallers.c' failed
make[4]: *** [generated_client_demarshallers.c] Error 1

Other stuff

Installed Emacs and cscope in the VM. Reminds me that I wonder why I now need to explicitly ssh-add on macOS Sierra. OSX used to pop up a neat dialog box

Karen Noel suggested I configure bip. Since it is not clear I have an account on the machine she was referring to, I thought I might as well set it up on a local server here. It took me a little while to get it working, but I finally got the gist of bip.conf thanks to the examples sent to me and to this document.

But I had not thought things through. Sadly, one of the servers I want to connect to is within the Red Hat firewall. So either I bring my little server within Red Hat’s firewall, which I’m not entirely sure is a good idea. Or I need to get an account on one of Red Hat’s servers, which will no doubt happen soon.



Author: Christophe de Dinechin

I try to change the world, but that's work in progress. If you want to know me, google "Christophe de Dinechin". Keywords: concept programming, virtualization, OS design, programming languages, video games, 3D, modern physics. Some stuff I did that I'm proud of: the first "true" 3D game for the PC, HP's big iron virtualization, real-time test systems for car electronics, some of the best games for the HP48 calculator, a theory of physics that makes sense (at least to me).

3 thoughts on “Trying to (finally) build stuff”

  1. …I don’t know how many times I type dnf install daily, I wish there was a dnf install what-i-need…
    There is `dnf builddep PACKAGE`, in your case `dnf builddep spice-server`. It should install most of the dependencies


    1. Thanks a lot for the tip, I will do that. I plan to also submit a small README patch to add the dependencies I saw which were not listed.

      But I was more referring to the set of packages that I always install right after a fresh installation, like Emacs, gnome-tweak-tool, etc. I guess I could just write a script that install these things for me.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s