Can we run Oracle VM Virtualbox inside LXC Container?


I’ve a requirement where in am trying to run virtualbox inside LXC ubuntu:18.04 container,but this is not working,where as i can run docker containers inside same.

Is this something expected? or is there any extra setting i will need to do at the container or profile level to have this run?

Please note- i would need Virtualbox to run in headless mode.

you don’t need nesting to run docker.

, LXD’s focus is system containers. That is, we run a full unmodified Linux distribution inside our containers. LXD for all intent and purposes doesn’t care about the workload running in the container. It just sets up the container namespaces and security policies, then spawns /sbin/init and waits for the container to stop.

Application containers such as those implemented by Docker or Rkt are pretty different in that they are used to distribute applications, will typically run a single main process inside them and be much more ephemeral than a LXD container.

you can run docker.
lxc launch ubuntu:20.04 docker -c security.nesting=true

1 Like

I think you can create vm using LXD then use VirtualBox inside it

lxd launch images:ubuntu/20.04 ub2004 --vm

Yes this is possible but headless virtual box. Also, one has to run grep --color vmx /proc/cpuinfo ( intel) if virtualization is allowed to host. If the output has the vmx flags, then Intel CPU host is capable of running hardware virtualization. Most of the cloud / server providers doesn’t allow this.

1 Like