I checked LXD myself on my laptop
$ lxc launch ubuntu-minimal-daily:j j-vm --ephemeral --vm $ lxc exec j-vm lscpu | grep '^CPU(s):' CPU(s): 1 => Yes it is one by default, but it just doesn't give any arguments at all $ ps axlf | grep qemu | grep j-vm 7 999 2014958 1 20 0 1776840 480184 - Sl ? 0:33 /snap/lxd/24918/bin/qemu-system-x86_64 -S -name j-vm -uuid 6e58b1c8-9484-4131-b4f4-d61e32556d28 -daemonize -cpu host,hv_passthrough -nographic -serial chardev:console -nodefaults -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=allow,resourcecontrol=deny -readconfig /var/snap/lxd/common/lxd/logs/j-vm/qemu.conf -spice unix=on,disable-ticketing=on,addr=/var/snap/lxd/common/lxd/logs/j-vm/qemu.spice -pidfile /var/snap/lxd/common/lxd/logs/j-vm/qemu.pid -D /var/snap/lxd/common/lxd/logs/j-vm/qemu.log -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas lxd
And at first it looks like LXD does limit things via cpusets only https://linuxcontainers.org/lxd/docs/stable-4.0/instances/#cpu-limits
Even with that set explicitly it behaves the same:
$ lxc launch ubuntu-minimal-daily:j j-vm --ephemeral --vm -c limits.cpu=1 Creating j-vm Starting j-vm $ lxc exec j-vm lscpu | grep '^CPU(s):' CPU(s): 1 $ ps axlf | grep qemu | grep j-vm 7 999 2033243 1 20 0 1777348 477060 - Sl ? 0:12 /snap/lxd/24918/bin/qemu-system-x86_64 -S -name j-vm -uuid 4c469ad8-136e-422a-9366-3503f072cddd -daemonize -cpu host,hv_passthrough -nographic -serial chardev:console -nodefaults -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=allow,resourcecontrol=deny -readconfig /var/snap/lxd/common/lxd/logs/j-vm/qemu.conf -spice unix=on,disable-ticketing=on,addr=/var/snap/lxd/common/lxd/logs/j-vm/qemu.spice -pidfile /var/snap/lxd/common/lxd/logs/j-vm/qemu.pid -D /var/snap/lxd/common/lxd/logs/j-vm/qemu.log -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas lxd
$ lxc launch ubuntu-minimal-daily:j j-vm --ephemeral --vm -c limits.cpu=2 Creating j-vm Starting j-vm $ lxc exec j-vm lscpu | grep '^CPU(s):' CPU(s): 2 $ ps axlf | grep qemu | grep j-vm 7 999 2036838 1 20 0 1984268 481300 - Sl ? 0:15 /snap/lxd/24918/bin/qemu-system-x86_64 -S -name j-vm -uuid 73ed3b5b-c1f9-4d8f-bed3-dc763a4329e2 -daemonize -cpu host,hv_passthrough -nographic -serial chardev:console -nodefaults -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=allow,resourcecontrol=deny -readconfig /var/snap/lxd/common/lxd/logs/j-vm/qemu.conf -spice unix=on,disable-ticketing=on,addr=/var/snap/lxd/common/lxd/logs/j-vm/qemu.spice -pidfile /var/snap/lxd/common/lxd/logs/j-vm/qemu.pid -D /var/snap/lxd/common/lxd/logs/j-vm/qemu.log -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas lxd
I checked LXD myself on my laptop
$ lxc launch ubuntu- minimal- daily:j j-vm --ephemeral --vm 24918/bin/ qemu-system- x86_64 -S -name j-vm -uuid 6e58b1c8- 9484-4131- b4f4-d61e32556d 28 -daemonize -cpu host,hv_passthrough -nographic -serial chardev:console -nodefaults -no-user-config -sandbox on,obsolete= deny,elevatepri vileges= allow,spawn= allow,resourcec ontrol= deny -readconfig /var/snap/ lxd/common/ lxd/logs/ j-vm/qemu. conf -spice unix=on, disable- ticketing= on,addr= /var/snap/ lxd/common/ lxd/logs/ j-vm/qemu. spice -pidfile /var/snap/ lxd/common/ lxd/logs/ j-vm/qemu. pid -D /var/snap/ lxd/common/ lxd/logs/ j-vm/qemu. log -smbios type=2, manufacturer= Canonical Ltd.,product=LXD -runas lxd
$ lxc exec j-vm lscpu | grep '^CPU(s):'
CPU(s): 1
=> Yes it is one by default, but it just doesn't give any arguments at all
$ ps axlf | grep qemu | grep j-vm
7 999 2014958 1 20 0 1776840 480184 - Sl ? 0:33 /snap/lxd/
And at first it looks like LXD does limit things via cpusets only /linuxcontainer s.org/lxd/ docs/stable- 4.0/instances/ #cpu-limits
https:/
Even with that set explicitly it behaves the same:
$ lxc launch ubuntu- minimal- daily:j j-vm --ephemeral --vm -c limits.cpu=1 24918/bin/ qemu-system- x86_64 -S -name j-vm -uuid 4c469ad8- 136e-422a- 9366-3503f072cd dd -daemonize -cpu host,hv_passthrough -nographic -serial chardev:console -nodefaults -no-user-config -sandbox on,obsolete= deny,elevatepri vileges= allow,spawn= allow,resourcec ontrol= deny -readconfig /var/snap/ lxd/common/ lxd/logs/ j-vm/qemu. conf -spice unix=on, disable- ticketing= on,addr= /var/snap/ lxd/common/ lxd/logs/ j-vm/qemu. spice -pidfile /var/snap/ lxd/common/ lxd/logs/ j-vm/qemu. pid -D /var/snap/ lxd/common/ lxd/logs/ j-vm/qemu. log -smbios type=2, manufacturer= Canonical Ltd.,product=LXD -runas lxd
Creating j-vm
Starting j-vm
$ lxc exec j-vm lscpu | grep '^CPU(s):'
CPU(s): 1
$ ps axlf | grep qemu | grep j-vm
7 999 2033243 1 20 0 1777348 477060 - Sl ? 0:12 /snap/lxd/
$ lxc launch ubuntu- minimal- daily:j j-vm --ephemeral --vm -c limits.cpu=2 24918/bin/ qemu-system- x86_64 -S -name j-vm -uuid 73ed3b5b- c1f9-4d8f- bed3-dc763a4329 e2 -daemonize -cpu host,hv_passthrough -nographic -serial chardev:console -nodefaults -no-user-config -sandbox on,obsolete= deny,elevatepri vileges= allow,spawn= allow,resourcec ontrol= deny -readconfig /var/snap/ lxd/common/ lxd/logs/ j-vm/qemu. conf -spice unix=on, disable- ticketing= on,addr= /var/snap/ lxd/common/ lxd/logs/ j-vm/qemu. spice -pidfile /var/snap/ lxd/common/ lxd/logs/ j-vm/qemu. pid -D /var/snap/ lxd/common/ lxd/logs/ j-vm/qemu. log -smbios type=2, manufacturer= Canonical Ltd.,product=LXD -runas lxd
Creating j-vm
Starting j-vm
$ lxc exec j-vm lscpu | grep '^CPU(s):'
CPU(s): 2
$ ps axlf | grep qemu | grep j-vm
7 999 2036838 1 20 0 1984268 481300 - Sl ? 0:15 /snap/lxd/