Running virtual machines with LXD 4.0

It says hivexregedit is missing. Do I just install it with snap?

doh, we need to add that to the snap package too


I have a manually built version of distrobuilder here so didn’t run into this.

Well I’ll happily be your guinea pig cause I really want windows on LXD xD

I’ve updated the packaging now with the needed packages, a new build of the snap should start shortly.

I did a refresh of distrobuilder and it seemed to update but it’s still showing
Error: Required tool "hivexregedit" is missing

I’ll try to take a look after dinner, it’s probably nothing too hard to fix.

1 Like

Ah, actually, I forgo that distrobuilder is a classic snap, so you can just install the missing packages and things should work, I believe they are:

  • libwin-hivex-perl
  • wimtools
1 Like

Ok so I installed both those packages using apt-get and then ran distrobuilder. It errored out with the following

Error: Failed to modify index 2 of "boot.wim": Failed to mount "boot.wim": Failed to run: wimlib-imagex mountrw /var/cache/distrobuilder.847803410/overlay/sources/boot.wim 2 /var/cache/distrobuilder.847803410/wim --allow-other: [ERROR] Error reading data from WIM file: Input/output error
ERROR: Exiting with error code 50:
       Could not read data from a file.

So I tried to find the file in /var/cache but distrobuilder is nowhere to be found in there.

Odd, it worked fine here. What ISO are you using?

Here I’m using a freshly downloaded Win10_20H2_v2_English_x64.iso.

As for the snap, unfortunately distrobuilder is a classic snap, so we can’t actually ship those dependencies as part of that snap or things get very broken
 So looks like the way out of that is indeed to install distrobuilder from the snap and the dependencies from the distro.

I’ll try a different iso then because I was trying windows ltsc

https://www.microsoft.com/en-ca/software-download/windows10 is what I’m using here.

Nope it’s not working and I just downloaded that tool.

root@testserver:/home/maihym# sudo distrobuilder repack-windows /home/maihym/Windows10_2-12-21.iso /home/maihym/LXDWindows10.iso
2021/02/13 04:45:59 Mounting Windows ISO ...
2021/02/13 04:45:59 Mounting driver ISO ...
2021/02/13 04:45:59 Injecting drivers into boot.wim (index 2)...
Error: Failed to retrieve wim file information: Failed to run: wimlib-imagex info /var/cache/distrobuilder.726777028/overlay/sources/install.wim: [ERROR] Can't open "/var/cache/distrobuilder.726777028/overlay/sources/install.wim" read-only: No such file or directory
ERROR: Exiting with error code 47:
       Failed to open a file.
root@testserver:/home/maihym# ls /var/cache/
apparmor  apt      fwupd     ldconfig  man        PackageKit  private
app-info  debconf  fwupdmgr  lxc       motd-news  pollinate   snapd
root@testserver:/home/maihym#

What OS are you running this on? I currently have Ubuntu 20.04 on my LXD test server and I tried making a new container with Debian 10 but distrobuilder still isnt working. I got this on my Debian 10 server

root@DistroBuilder:~#  distrobuilder repack-windows /root/Windows10_2-12-21.iso /root/LXDWindows10.iso
2021/02/13 19:26:40 Mounting Windows ISO ...
Error: Failed to run: mount -o loop /root/Windows10_2-12-21.iso /var/cache/distrobuilder.130257117/source: mount: /var/cache/distrobuilder.130257117/source: mount failed: Operation not permitted.

Are you running the distrobuilder command inside a container? If so, then an unprivileged container does not allow you to mount things. You might get away with some special configuration, but without such configuration the unprivileged container will not allow distrobuilder to mount the loop file as it requires.

Here is my successful creation of the ISO (distrobuilder snap from edge).
It requires temporary space from /tmp, as much as the size of the ISO plus the size of the drivers ISO (about 450MB).
Those 450MB are downloaded from the Internet.

$ sudo distrobuilder repack-windows Win10_1809Oct_English_x64.iso Win10_1809Oct_English_x64-distrobuilder.iso 
[sudo] password for user: 
2021/02/13 23:15:57 Mounting Windows ISO ...
2021/02/13 23:15:57 Downloading drivers ISO ...
2021/02/13 23:24:19 Mounting driver ISO ...
2021/02/13 23:24:20 Injecting drivers into boot.wim (index 2)...
2021/02/13 23:24:24 Injecting drivers into install.wim (index 1)...
2021/02/13 23:25:01 Injecting drivers into install.wim (index 2)...
2021/02/13 23:25:09 Injecting drivers into install.wim (index 3)...
2021/02/13 23:25:17 Injecting drivers into install.wim (index 4)...
2021/02/13 23:25:25 Injecting drivers into install.wim (index 5)...
2021/02/13 23:25:33 Injecting drivers into install.wim (index 6)...
2021/02/13 23:25:41 Injecting drivers into install.wim (index 7)...
2021/02/13 23:25:49 Injecting drivers into install.wim (index 8)...
2021/02/13 23:25:57 Injecting drivers into install.wim (index 9)...
2021/02/13 23:26:05 Injecting drivers into install.wim (index 10)...
2021/02/13 23:26:13 Injecting drivers into install.wim (index 11)...
2021/02/13 23:26:21 Generating new ISO ...
$ 

So I read that the mount command doesnt like it when you use -r on disks and to use -r -O or something like that so that’s why it wasnt working on LXD containers I think. But I’m trying to run this on the actual server but I’m getting

root@testserver:~# sudo distrobuilder repack-windows /root/Windows10_2-12-21.iso /root/LXDWindows10.iso
2021/02/14 01:22:33 Mounting Windows ISO ...
2021/02/14 01:22:33 Downloading drivers ISO ...
2021/02/14 01:27:27 Mounting driver ISO ...
2021/02/14 01:27:27 Injecting drivers into boot.wim (index 2)...
Error: Failed to retrieve wim file information: Failed to run: wimlib-imagex info /var/cache/distrobuilder.429557114/overlay/sources/install.wim: [ERROR] Can't open "/var/cache/distrobuilder.429557114/overlay/sources/install.wim" read-only: No such file or directory
ERROR: Exiting with error code 47:
       Failed to open a file.

I checked /var/cache and don’t see a distrobuilder folder.

It’s a cache directory so I would expect it to get automatically deleted on exit.

What OS are you running on your server?

I’ve had no problem repacking the ISO using Ubuntu 20.04 at least.
If you need a quick solution, maybe create an Ubuntu 20.04 VM and do the ISO repacking inside it?

The OS I use is Ubuntu 20.04.1 LTS. So I tried that but somehow the VM messed up and ran out of storage so I made a new storage pool and added the root disk to it but now new containers don’t have networking built in but 2 of my containers do and I think it’s because I gave them static ips when I first setup the containers. How can I setup the new storage pool profile to set the containers networking automatically again?

+-------------+---------+---------------------+------+-----------------+-----------+
|    NAME     |  STATE  |        IPV4         | IPV6 |      TYPE       | SNAPSHOTS |
+-------------+---------+---------------------+------+-----------------+-----------+
| GameServer  | RUNNING | 10.128.182.3 (eth0) |      | CONTAINER       | 0         |
+-------------+---------+---------------------+------+-----------------+-----------+
| WebServer   | RUNNING | 10.128.182.2 (eth0) |      | CONTAINER       | 0         |
+-------------+---------+---------------------+------+-----------------+-----------+
| extDB3Build | RUNNING |                     |      | CONTAINER       | 0         |
+-------------+---------+---------------------+------+-----------------+-----------+
| ubuntu      | STOPPED |                     |      | VIRTUAL-MACHINE | 0         |
+-------------+---------+---------------------+------+-----------------+-----------+