simos
(Simos Xenitellis)
February 28, 2021, 7:05pm
207
It’s the following.
$ lxc start win10 --console=vga
Error: Failed to start device "eth0": Failed to run: ip link add dev maca2b0d635 link enp3s0 type macvtap mode bridge: RTNETLINK answers: Device or resource busy
Try `lxc info --show-log win10` for more info
$ lxc info --show-log win10
Name: win10
Location: none
Remote: unix://
Architecture: x86_64
Created: 2021/02/27 17:50 UTC
Status: Stopped
Type: virtual-machine
Profiles: default, macvlan
Error: open /var/snap/lxd/common/lxd/logs/win10/qemu.log: no such file or directory
stgraber
(Stéphane Graber)
February 28, 2021, 7:25pm
208
Ah, okay, so it’s looking like some kind of compatibility issue with macvlan/macvtap and your network driver.
muslu
(Muslu Yüksektepe)
March 1, 2021, 2:42pm
209
Hi all;
I tested Windows vm in LXC on Ubuntu 18.04 and its worked.
Note: remmina (for slice) or virt-viewer can connect vga.
apt install -yqq remmina-plugin-spice virt-viewer
snap install distrobuilder --classic --edge
apt install -y libguestfs-tools wimtools
distrobuilder repack-windows /home/muslu/win10.iso /home/muslu/win10_distrobuilder.iso
lxc init win10 --empty --vm -c security.secureboot=false
lxc config device override win10 root size=50GiB
lxc config device add win10 iso disk source=/home/muslu/win10_distrobuilder.iso boot.priority=10
lxc start win10 --console=vga
If install virt-viewer than vga windows will be open automaticly after lxc start.
2 Likes
thanks Muslu. It’s very helpfull.
simos
(Simos Xenitellis)
March 4, 2021, 4:53pm
211
@muslu , which executable is provided from the wimtools package that is needed by distrobuilder?
muslu
(Muslu Yüksektepe)
March 5, 2021, 10:39am
212
Hi all;
Sorry for delay.
I wanted to test all the options.
When i test first time with my own pc (Ubuntu 18.04), i did get error for win parse and i installed wimtools.
i tested same code on my other pc (Ubuntu 18.04) but i did get more errors.
distrobuilder repack-windows /home/muslu/win10.iso /home/muslu/win10_distrobuilder.iso
2021/03/05 13:26:29 Mounting Windows ISO ...
2021/03/05 13:26:29 Mounting driver ISO ...
2021/03/05 13:26:29 Injecting drivers into boot.wim (index 2)...
2021/03/05 13:26:36 Injecting drivers into install.wim (index 1)...
Error: Failed to modify index 1 of "install.wim": Failed to inject drivers: Failed to edit Windows DRIVERS registry for driver "NetKVM": Failed to run: hivexregedit --merge --prefix='HKEY_LOCAL_MACHINE\DRIVERS' /var/cache/distrobuilder.507518749/wim/Windows/System32/config/DRIVERS: reg_import: cannot create \DriverDatabase\DeviceIds\pci\VEN_1AF4&DEV_1000 since parent \DriverDatabase\DeviceIds\pci\ does not exist at /usr/lib/x86_64-linux-gnu/perl5/5.26/Win/Hivex/Regedit.pm line 341, <FILE> line 5.
Win::Hivex::Regedit::_merge_node(CODE(0x557773bab150), HASH(0x557773ca8f90), "\DriverDatabase\DeviceIds\pci\VEN_1AF4\x{26}DEV_1000", ARRAY(0x557773d2d190), ARRAY(0x557773d2d148)) called at /usr/lib/x86_64-linux-gnu/perl5/5.26/Win/Hivex/Regedit.pm line 196
Win::Hivex::Regedit::reg_import(GLOB(0x557773d5d960), CODE(0x557773bab150)) called at /usr/bin/hivexregedit line 331
I will try again and report to you.
Thansk for everyting about lxc/lxd/lxcfs/distrobuilder and etc.
TomvB
(Tom)
March 11, 2021, 4:58pm
214
@stgraber How can i limit the bandwidth?
like: lxc config device set VM eth0 limits.ingress 100Mbit
stgraber
(Stéphane Graber)
March 11, 2021, 5:00pm
215
limits.ingress and limits.egress should work as expected, though note that they only work with bridges and cannot work with macvlan, physical or sr-iov.
1 Like
TomvB
(Tom)
March 11, 2021, 7:36pm
216
Thanks! Using macvlan.
nvm: works now… using root partition only.
TomvB
(Tom)
March 12, 2021, 12:05pm
217
I have a new test server available for LXD.
CPU: Intel Xeon W3520
egrep -c ‘(vmx|svm)’ /proc/cpuinfo
8
kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
Server OS: 20.04
2 disks in RAID1 with LVM
The VM starts after the launch (ipv6 only)
lxc launch ubuntu:20.04 test1 --vm
Then the VM stops (after a few seconds) and I can’t start the VM
Error:
Error: open /var/snap/lxd/common/lxd/logs/test1/qemu.log: no such file or directory
lxc info
driver: lxc | qemu
driver_version: 4.0.6 | 5.2.0
firewall: xtables
kernel: Linux
kernel_architecture: x86_64
kernel_features:
Any idea @stgraber
Update: I cant delete or start the VM after this. Reboot required to delete it.
After a long wait…
user@node:~$ lxc delete test1
Error: Error deleting storage volume: Error removing LVM logical volume: Failed to run: lvremove -f /dev/LXD/virtual-machines_test1.block: Logical volume LXD/virtual-machines_test1.block in use.
lxc start test1
Error: virtiofsd failed to bind socket within 10s
Try lxc info --show-log test1 for more info
stgraber
(Stéphane Graber)
March 12, 2021, 8:23pm
218
Anything scary looking in dmesg? Sounds like that system isn’t having a good day.
TomvB
(Tom)
March 12, 2021, 8:37pm
219
Nope, nothing. Reinstallation doesn’t help either
Container:
t=2021-03-12T20:47:26+0000 lvl=info msg="Started container" action=start created=2021-03-12T11:04:26+0000 ephemeral=false instance=test instanceType=container project=default stateful=false used=2021-03-12T11:20:09+0000
VM:
t=2021-03-12T20:53:31+0000 lvl=warn msg="Error getting disk usage" err="strconv.ParseFloat: parsing \"\": invalid syntax" instance=test1 instanceType=virtual-machine project=default
QEMU log:
KVM internal error. Suberror: 3
extra data[0]: 800000ec
extra data[1]: 31
extra data[2]: 81
extra data[3]: 30db0
RAX=0000000000000000 RBX=0000000000000001 RCX=0000000000000001 RDX=00000000000001ca
RSI=ffff9823b5d1cba8 RDI=0000000000000001 RBP=ffffa46d80077e90 RSP=ffffa46d80077e78
R8 =000000001327186b R9 =0000000000000000 R10=0000000000002000 R11=0000000000002000
R12=0000000000000001 R13=ffff9823401c8c80 R14=0000000000000000 R15=0000000000000000
RIP=ffffffffadf54c14 RFL=00000246 [—Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0000 0000000000000000 ffffffff 00c00000
CS =0010 0000000000000000 ffffffff 00a09b00 DPL=0 CS64 [-RA]
SS =0000 0000000000000000 ffffffff 00c00000
DS =0000 0000000000000000 ffffffff 00c00000
FS =0000 0000000000000000 ffffffff 00c00000
GS =0000 ffff9823b5d00000 ffffffff 00c00000
LDT=0000 0000000000000000 ffffffff 00c00000
TR =0040 fffffe0000036000 0000206f 00008b00 DPL=0 TSS64-busy
GDT= fffffe0000034000 0000007f
IDT= fffffe0000000000 00000fff
CR0=80050033 CR2=00000000ffffffff CR3=0000000029a0a000 CR4=000006a0
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000d01
Code=00 85 c0 7e 07 0f 00 2d b6 c1 4b 00 fb f4 8b 05 74 8f 78 00 <65> 44 8b 25 14 b5 0b 52 85 c0 0f 8f 85 00 00 00 5b 41 5c 41 5d 5d c3 65 8b 05 fe b4 0b 52
Tested with HWE (without success)
Tested with Proxmox (VM/LXC) instead of Ubuntu 20.04 with LXD and it works.
@stgraber I’ll use proxmox for now. I don’t know why it is going wrong on ubuntu 20.04.
muslu
(Muslu Yüksektepe)
March 19, 2021, 8:29am
220
OK!.
distrobuilder is working like a magic.
opened 12:46PM - 05 Mar 21 UTC
closed 08:13AM - 19 Mar 21 UTC
Hi all;
When I tested run win10 on lxd with console=vga on my own pc (Ubuntu… 18.04), i did get error for parse wim file and i installed **wimtools** with apt. But I didnt create note for error. I am sorry for that.
I tested again with my other pc (Ubuntu 18.04) with same code but i did get more errors.
```
snap install distrobuilder --classic --edge
apt install -y libguestfs-tools wimtools remmina-plugin-spice virt-viewer
lxc init win10 --empty --vm -c security.secureboot=false -c limits.cpu=2 -c limits.memory=2GB
lxc config device override win10 root size=20GiB
distrobuilder repack-windows /home/muslu/win10.iso /home/muslu/win10_distrobuilder.iso
lxc config device add win10 iso disk source=/home/dogancan/win10_distrobuilder.iso boot.priority=10
lxc start win10 --console=vga
```
### Last errors.
I already use --edge. i removed and install again with edge but still same error.
I will test with different Win10 and Win2012R2 ISO's.
```
muslu@muslu:~$ snap refresh --edge --classic distrobuilder
snap "distrobuilder" has no updates available
muslu@muslu:~$ sudo snap remove distrobuilder
[sudo] password for muslu:
distrobuilder kaldırıldı
muslu@muslu:~$ sudo snap install --edge --classic distrobuilder
distrobuilder (edge) git-2b6b394 from Stéphane Graber (stgraber) installed
muslu@muslu:~$ distrobuilder repack-windows /home/muslu/win10.iso /home/muslu/win10_distrobuilder.iso
You must be root to run this tool
muslu@muslu:~$ sudo distrobuilder repack-windows /home/muslu/win10.iso /home/muslu/win10_distrobuilder.iso
2021/03/05 15:28:05 Mounting Windows ISO ...
2021/03/05 15:28:05 Mounting driver ISO ...
2021/03/05 15:28:05 Injecting drivers into boot.wim (index 2)...
2021/03/05 15:28:13 Injecting drivers into install.wim (index 1)...
Failed to unmount overlay: device or resource busy
Failed to remove overlay directory: remove /var/cache/distrobuilder.944432016/overlay: device or resource busy
Error: Failed to modify index 1 of "install.wim": Failed to inject drivers: Failed to edit Windows DRIVERS registry for driver "NetKVM": Failed to run: hivexregedit --merge --prefix='HKEY_LOCAL_MACHINE\DRIVERS' /var/cache/distrobuilder.944432016/wim/Windows/System32/config/DRIVERS: reg_import: cannot create \DriverDatabase\DeviceIds\pci\VEN_1AF4&DEV_1000 since parent \DriverDatabase\DeviceIds\pci\ does not exist at /usr/lib/x86_64-linux-gnu/perl5/5.26/Win/Hivex/Regedit.pm line 341, <FILE> line 5.
Win::Hivex::Regedit::_merge_node(CODE(0x559e6612e020), HASH(0x559e66231298), "\\DriverDatabase\\DeviceIds\\pci\\VEN_1AF4\x{26}DEV_1000", ARRAY(0x559e662af970), ARRAY(0x559e662af958)) called at /usr/lib/x86_64-linux-gnu/perl5/5.26/Win/Hivex/Regedit.pm line 196
Win::Hivex::Regedit::reg_import(GLOB(0x559e662e0278), CODE(0x559e6612e020)) called at /usr/bin/hivexregedit line 331
```
Win2012 R2 / https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2012-r2-essentials
```
root@muslu:~# distrobuilder repack-windows /home/muslu/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_SERVER_SOLUTION_EN-US-IRM_SSSO_X64FRE_EN-US_DV5.ISO /home/muslu/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_SERVER_SOLUTION_EN-US-IRM_SSSO_X64FRE_EN-US_DV5_distrobuilder.iso
```
```
Error: Failed to detect Windows version. Please provide the version using the --version flag
Usage:
distrobuilder repack-windows <source-iso> <target-iso> [--drivers=DRIVERS] [flags]
Flags:
--drivers Path to drivers ISO
-h, --help help for repack-windows
Global Flags:
--cache-dir Cache directory
--cleanup Clean up cache directory (default true)
-o, --options Override options (list of key=value)
-t, --timeout Timeout in seconds
--version Print version number
```
Other ISO for Win2012 R2
```
distrobuilder repack-windows /home/muslu/Windows_Server_2012_R2_x64.iso /home/muslu/Windows_Server_2012_R2_x64_distrobuilder.iso
2021/03/05 15:32:50 Mounting Windows ISO ...
2021/03/05 15:32:50 Mounting driver ISO ...
2021/03/05 15:32:50 Injecting drivers into boot.wim (index 2)...
Error: Failed to modify index 2 of "boot.wim": Failed to inject drivers: Failed to edit Windows DRIVERS registry for driver "NetKVM": Failed to run: hivexregedit --merge --prefix='HKEY_LOCAL_MACHINE\DRIVERS' /var/cache/distrobuilder.905171162/wim/Windows/System32/config/DRIVERS: reg_import: cannot create \DriverDatabase\DeviceIds\pci\VEN_1AF4&DEV_1000 since parent \DriverDatabase\DeviceIds\pci\ does not exist at /usr/lib/x86_64-linux-gnu/perl5/5.26/Win/Hivex/Regedit.pm line 341, <FILE> line 5.
Win::Hivex::Regedit::_merge_node(CODE(0x5599001e61e0), HASH(0x559900302f90), "\\DriverDatabase\\DeviceIds\\pci\\VEN_1AF4\x{26}DEV_1000", ARRAY(0x559900387178), ARRAY(0x559900387160)) called at /usr/lib/x86_64-linux-gnu/perl5/5.26/Win/Hivex/Regedit.pm line 196
Win::Hivex::Regedit::reg_import(GLOB(0x5599003b7960), CODE(0x5599001e61e0)) called at /usr/bin/hivexregedit line 331
```
stgraber
(Stéphane Graber)
April 19, 2021, 1:47pm
222
I’ve updated the instructions to reference the work we did on distrobuilder and on LXD booting the resulting ISO, no more need for workarounds.
1 Like
Are there any pre-built/community images of win10 around which would spare me the effort of creating it as part of a small test?
I was hoping to see if I could use this with gitlab-runner and lxd executors…
stgraber
(Stéphane Graber)
May 18, 2021, 1:22pm
226
No, unfortunately it’s not legal to re-distribute a Windows ISO image (or VM image) which is why we can only provide the tool that generates it for yourself and can’t just make the result available as we do for our other images.
1 Like
stgraber
(Stéphane Graber)
Split this topic
May 27, 2021, 2:36pm
227
6 posts were split to a new topic: Unable to export/import Windows VM
stgraber
(Stéphane Graber)
Split this topic
June 3, 2021, 6:56pm
228
3 posts were split to a new topic: VM not booting from Windows ISO
igoryonya
(Igoryonya)
June 16, 2021, 4:33am
229
Is there or will be there a new tutorial for LXD version 4.0, as you have for LXD version 2.0?