dngray
(Daniel Gray)
November 9, 2020, 2:12pm
139
stgraber:
echo -n '-drive file=/home/USER/Downloads/Win10_1909_English_x64.iso,index=0,media=cdrom,if=ide -drive file=/home/USER/Downloads/virtio-win-0.1.173.iso,index=1,media=cdrom,if=ide' | lxc config set win10 raw.qemu -
Start the VM: lxc start win10 --console
Repeatedly hit ESC in that console (even before any output) to enter the firmware menu.
I assume something like this can be used to boot an environment from a live-cd in order to add some users. For example the archlinux instance doesn’t have cloud-init
, so I expect manually adding users is a way?
Add boot ISO to boot device
sudo echo -n '-drive file=/os/archlinux/2020.11.01/archlinux-2020.11.01-x86_64.iso,index=0,media=cdrom,if=ide' | sudo lxc config set archvm raw.qemu -
I’ve already created a VM with:
lxc init images:archlinux/current/amd64 archvm --vm -c security.secureboot=false
The environment will automatically boot from the primary disk. It seems hitting ESC isn’t enough to bring up the boot menu. Did I need to change some of the boot options ?
I did try hitting escape but that wasn’t helping.
stgraber
(Stéphane Graber)
November 9, 2020, 3:55pm
140
For ArchLinux since it has a running agent, just use:
echo user:passwd | lxc exec NAME -- chpasswd
Or something similar. You have a root shell easily accessible with lxc exec NAME bash
so just use that
stgraber
(Stéphane Graber)
November 9, 2020, 3:56pm
141
ESC works but the time window is very very narrow unless your distribution has a build of EDK2 with an increased timeout (as we do in the LXD snap).
dngray
(Daniel Gray)
November 9, 2020, 5:05pm
142
Ah yes, that probably wasn’t working because of the issue you answered in Lxd-agent: No such file or directory - #4 by stgraber
ESC works but the time window is very very narrow unless your distribution has a build of EDK2 with an increased timeout (as we do in the LXD snap).
Right. I don’t think they have a patch for that . Are you able to point me to the commit/patch that increases it?
stgraber
(Stéphane Graber)
November 9, 2020, 6:28pm
143
First patch is to make DHCPv6 netboot work properly, second is for the fancy LXD bootscreen, third is the boot delay increase.
tonys1431
(Tony Santos)
December 23, 2020, 3:20pm
144
Hi,
I posted the following regarding an error I am getting when trying to boot into Windows… can anyone help?
Hello I have been trying desperately to resolve the following error:
[lxc_win10_error]
I have followed the steps several times in this document:
and the issue always happens. When I use the same Win10 ISO file in Virtual Box I do not receive this error.
Here is the output from the ‘lxc info’ command"
$ lxc info
config: {}
api_extensions:
storage_zfs_remove_snapshots
container_host_shutdown_timeout
container_stop_priority
container_syscall_filtering
auth_pki
container_last_used_at
eta…
Appreciate any help!
Thanks,
Tony
Mir_Zmu
(MirZmu)
January 4, 2021, 8:53pm
145
Hi,
I’m trying to run lxd vm’s on my Arch Linux machine, but I get the same error (image doesn’t mater):
[mz@V7590 ~]$ lxc launch ubuntu:20.04 vm1 --vm --profile myprofile --profile vm
Creating vm1
Starting vm1
Error: Failed to run: forklimits limit=memlock:unlimited:unlimited – /usr/bin/qemu-system-x86_64 -S -name vm1 -uuid 8ccbcfe8-1392-4848-a5fe-75382a0e2fdb -daemonize -cpu host -nographic -serial chardev:console -nodefaults -no-reboot -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=deny,resourcecontrol=deny -readconfig /var/log/lxd/vm1/qemu.conf -pidfile /var/log/lxd/vm1/qemu.pid -D /var/log/lxd/vm1/qemu.log -chroot /var/lib/lxd/virtual-machines/vm1 -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas nobody: qemu-system-x86_64:/var/log/lxd/vm1/qemu.conf:27: There is no option group ‘spice’
qemu-system-x86_64: -readconfig /var/log/lxd/vm1/qemu.conf: read config /var/log/lxd/vm1/qemu.conf: Invalid argument
: Process exited with a non-zero value
Try lxc info --show-log local:vm1
for more info
[mz@V7590 ~]$ sudo cat /var/log/lxd/vm1/qemu.conf
[sudo] password for mz:
Machine
[machine]
graphics = “off”
type = “q35”
accel = “kvm”
usb = “off”
graphics = “off”
[global]
driver = “ICH9-LPC”
property = “disable_s3”
value = “1”
[global]
driver = “ICH9-LPC”
property = “disable_s4”
value = “1”
[boot-opts]
strict = “on”
Console
[chardev “console”]
backend = “pty”
Graphical console
[spice] // Line number 27 //
unix = “on”
addr = “/var/log/lxd/vm1/qemu.spice”
disable-ticketing = “on”
…
[mz@V7590 ~]$ lxc info --show-log local:vm1
Name: vm1
Location: none
Remote: unix://
Architecture: x86_64
Created: 2021/01/04 20:22 UTC
Status: Stopped
Type: virtual-machine
Profiles: myprofile, vm
Error: open /var/log/lxd/vm1/qemu.log: no such file or directory
[mz@V7590 ~]$ lxd --version
4.9
[mz@V7590 ~]$ lxc --version
4.9
[mz@V7590 ~]$ pacman -Ss spice-gtk
community/spice-gtk 0.38-1 [installed]
GTK+ client library for SPICE
[mz@V7590 ~]$ which virt-viewer
/usr/bin/virt-viewer
[mz@V7590 ~]$ uname -r
5.4.86-1-lts
Launching vm’s with options --console=vga or --console=console, the result is exactly the same…
At this setup lxd containers are working fine…
Could you help me ?
Thx in advance…
stgraber
(Stéphane Graber)
January 4, 2021, 8:55pm
146
That’s an issue with your Linux distribution, your build of qemu wasn’t built with spice support.
I believe I had the LXD maintainer on Arch mention that to us earlier so there may be an open bug report against qemu in Arch to have this fixed.
tired
(tired)
January 7, 2021, 3:49am
147
Hello. I am trying build windows image, but stuck with this error.
[Error: Failed to run: forklimits limit=memlock:unlimited:unlimited fd=3 – /usr/bin/qemu-system-x86_64 -S -name win10 -uuid d648ea55-a11d-4bed-b07a-7e4721319ae4 -daemonize -cpu host -nographic -serial chardev:console -nodefaults -no-reboot -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=deny,resourcecontrol=deny -readconfig /var/log/lxd/win10/qemu.conf -pidfile /var/log/lxd/win10/qemu.pid -D /var/log/lxd/win10/qemu.log -chroot /var/lib/lxd/virtual-machines/win10 -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas nobody -drive file=/run/media/BIG/DWN/Win10_20H2_v2_Russian_x64.iso,index=0,media=cdrom,if=ide -drive file=/run/media/BIG/DWN/virtio-win-0.1.173.iso,index=1,media=cdrom,if=ide: [242623] aa-exec: ERROR: AppArmor interface not available
: Process exited with a non-zero value
Try lxc info --show-log win10
for more info
lxc --version 4.9
Any advice?
tomp
(Thomas Parrott)
January 7, 2021, 9:00am
148
Looks like AppArmor isn’t available on your host system. What OS are you running and are you using LXD from the snap package?
tired
(tired)
January 7, 2021, 4:16pm
149
ManjaroLinux 20.2.1. LXD from official Repositories.
edacval
January 9, 2021, 2:23am
150
That’s an issue with your Linux distribution, your build of qemu wasn’t built with spice support.
I believe I had the LXD maintainer on Arch mention that to us earlier so there may be an open bug report against qemu in Arch to have this fixed.
This is upstream qemu 5.2.0 bug . I spent a few hours to isolate the first bad comit.
tomp
(Thomas Parrott)
January 11, 2021, 11:48am
151
Does your kernel have appamor support? As we check for the existence of /sys/kernel/security/apparmor
and the aa-exec
command as indicating that AppArmor is supported.
stgraber
(Stéphane Graber)
January 11, 2021, 3:58pm
152
What’s the content of /sys/module/apparmor/parameters/enabled
?
tomp
(Thomas Parrott)
January 11, 2021, 3:58pm
153
What kernel version are you using and can you supply the output of sudo aa-enabled
?
tired
(tired)
January 11, 2021, 7:42pm
154
[d@tired ~]$ cat /sys/module/apparmor/parameters/enabled
Y
[d@tired ~]$ sudo aa-enabled
[sudo] password for d:
Yes
tomp
(Thomas Parrott)
January 11, 2021, 8:34pm
155
What version of AppAmor do you have?
tomp
(Thomas Parrott)
January 12, 2021, 9:30am
157
So it looks like there is some issue with AppArmor on your OS, as its reporting that AppArmor is available and enabled, but when we try to run qemu via apparmor using aa-exec
the command fails. Might be worth opening an issue with your distribution as this might be a known issue.
tired
(tired)
January 16, 2021, 6:42pm
158
i switched kernel to 5.10, it help thanks, no more AppArmor error. Unfortunately there is another error, i guess its also problem with linux distro.
[tired d]# lxc start win10 --console
^[^[^[^[^[^[^[^[^[^[^[^[^[Error: Failed to run: forklimits limit=memlock:unlimited:unlimited fd=3 – /usr/bin/qemu-system-x86_64 -S -name win10 -uuid d648ea55-a11d-4bed-b07a-7e4721319ae4 -daemonize -cpu host -nographic -serial chardev:console -nodefaults -no-reboot -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=deny,resourcecontrol=deny -readconfig /var/log/lxd/win10/qemu.conf -pidfile /var/log/lxd/win10/qemu.pid -D /var/log/lxd/win10/qemu.log -chroot /var/lib/lxd/virtual-machines/win10 -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas nobody -drive file=/run/media/BIG/DWN/Win10_20H2_v2_Russian_x64.iso,index=0,media=cdrom,if=ide -drive file=/run/media/BIG/DWN/virtio-win-0.1.173.iso,index=1,media=cdrom,if=ide: qemu-system-x86_64:/var/log/lxd/win10/qemu.conf:27: There is no option group ‘spice’
this is /var/log/lxd/win10/qemu.conf
Graphical console
[spice]
unix = “on”
addr = “/var/log/lxd/win10/qemu.spice”
disable-ticketing = “on”