[lxc-users] Booting a Freebsd VM inside a container

Anjali Kulkarni anjali at juniper.net
Fri Feb 20 13:16:54 UTC 2015


Thanks, so for networking to work, all you need to do is add the
networking links to the config file in /var/lib/lxc/<lxc_name> and then
networking should work in the VM as it would in a normal LXC.
Regarding the freebsd VM, I understand that the host OS has to be the same
as a container OS, but what I am looking for is a way to run the freebsd
VM in emulated mode via qemu. Theoretically, if I can run a freebsd VM on
the host OS via qemu/kvm, I should be able to run it inside the container
via qemu as well right? I don¹t want to map the VM¹s OS to the underlying
OS, but just use qemu for the emulation part. Does that make sense?

On 2/19/15, 6:51 PM, "Fajar A. Nugraha" <list at fajar.net> wrote:

>On Fri, Feb 20, 2015 at 12:56 AM, Anjali Kulkarni <anjali at juniper.net>
>wrote:
>> Hi,
>>
>> The following link mentions booting an Ubuntu VM inside a container:
>> 
>>(https://www.stgraber.org/2012/03/04/booting-an-ubuntu-12-04-virtual-mach
>>ine-in-an-lxc-container/)
>>
>> However I had 2 qs
>> 1. If we do boot a VM inside the container as mentioned in the article,
>> would it be of any use like a normal VM from the networking perspective?
>
>In "normal" setup, yes. It would use a bridge.
>
>> Since the VM needs emulated interfaces via qemu, it seems having VM like
>
>lxc does not use qemu. kvm and xen hvm does.
>
>> networking(emulated interfaces connecting to linux bridges etc.)
>>working on
>> this VM is either not possible or would need some kind of mapping from
>>the
>> qemu interfaces to veth interfaces and define the config file
>>accordingly?
>
>what is it that you want to achieve? There are other networking
>methods for lxc that does not include bridge if you have a problem
>with that (e.g. concerns about packet snooping)
>
>> 2. Is it possible to boot a Freebsd VM image similar to what is
>>described in
>> link above?
>
>Short answer: no.
>Long anwser: read
>http://en.wikipedia.org/wiki/Operating-system-level_virtualization
>
>containers (lxc, solaris zones, etc) uses the same kernel as the host,
>so the "OS" running inside the containers must be able to run on
>whatever kernel the host is running. There are some cases which might
>SEEM like an exception, but in fact still follows that rule:
>
>- running a linux distro on the container with different arch:
>https://www.stgraber.org/2012/02/03/ever-wanted-an-armel-or-armhf-containe
>r-on-an-x86-machine-its-now-possible-with-lxc-in-ubuntu-precise/
>. This is achieved with the help of qemu-user
>
>- running a very old linux distro (e.g. centos3.x) on solaris zones:
>http://docs.oracle.com/cd/E19112-01/ctr.mgr11/817-1592/gchhy/index.html
>. This is possible since the solaris kernel can emulate certain linux
>syscalls
>
>-- 
>Fajar
>_______________________________________________
>lxc-users mailing list
>lxc-users at lists.linuxcontainers.org
>http://lists.linuxcontainers.org/listinfo/lxc-users



More information about the lxc-users mailing list