[Lxc-users] LXC on Fedora

Antoine Gaillard antoine.gaillard13 at gmail.com
Wed Feb 6 16:03:29 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
 
Le 06/02/2013 12:34, Cristian Falcas a écrit :
> I'm using the staging lxc on fedora 18 with fedora 18 guests, so it's working.
>
> What i did (it's root all the waydown):
> 1. Compile lxc
> cd ~
> git clone https://github.com/lxc/lxc
> cd lxc
> ./autogen.sh && ./configure && make && make install
>
> 2. i didn't use the fedora template from lxc, but the openvz one (I
> use x86 because of pentium4):
> wget http://download.openvz.org/template/precreated/fedora-17-x86.tar.gz
>
> 3. uncompress in /mnt/files/lxc/fedora-x86/
>
> 4. Use this as the template:
>
> cat /mnt/files/lxc/lxc_template.conf
> lxc.utsname = localhost.localdomain
> lxc.rootfs = /mnt/files/lxc/fedora-x86/
> #lxc.tty = 10
>
> lxc.network.type = veth
> lxc.network.flags = up
> lxc.network.link = bridge_lxc
> lxc.network.name = eth0
> lxc.network.hwaddr = a2:cd:48:ff:ff:ff
>
> lxc.autodev = 1
> lxc.pts = 1024
> lxc.arch = i386
>
> #lxc.cgroup.devices.deny = a
> lxc.cgroup.memory.limit_in_bytes = 128M
> # /dev/null and zero
> lxc.cgroup.devices.allow = c 1:3 rwm
> lxc.cgroup.devices.allow = c 1:5 rwm
> # consoles
> lxc.cgroup.devices.allow = c 5:1 rwm
> lxc.cgroup.devices.allow = c 5:0 rwm
> lxc.cgroup.devices.allow = c 4:0 rwm
> lxc.cgroup.devices.allow = c 4:1 rwm
> # /dev/{,u}random
> lxc.cgroup.devices.allow = c 1:9 rwm
> lxc.cgroup.devices.allow = c 1:8 rwm
> lxc.cgroup.devices.allow = c 136:* rwm
> lxc.cgroup.devices.allow = c 5:2 rwm
> # rtc
> lxc.cgroup.devices.allow = c 254:0 rwm
> # tun
> lxc.cgroup.devices.allow = c 10:200 rwm
>
> 5. Create the bridge:
>
> [root at wikitiki q]# cat /etc/sysconfig/network-scripts/ifcfg-bridge_lxc
> DEVICE=bridge_lxc
> TYPE=Bridge
> NM_CONTROLED=no
> BOOTPROTO=static
> IPADDR=192.168.0.1
> NETMASK=255.255.255.0
> NETWORK=192.168.0.0
> ONBOOT=yes
>
> 6. dhcp configuration:
>
> [root at wikitiki q]# cat /etc/dnsmasq.d/lxc.conf
> interface=bridge_lxc
> dhcp-range=192.168.0.0,static
> dhcp-option=3,192.168.0.1
> resolv-file=/etc/resolv.conf
> domain-needed
> bogus-priv
> no-hosts
> dns-forward-max=150
> cache-size=1000
> #no-negcache
> neg-ttl=3600
> no-poll
>
> dhcp-host=a2:cd:48:02:02:02,192.168.0.2
> dhcp-host=a2:cd:48:ff:ff:ff,192.168.0.222
>
> 7, start bridge, dhcp
>
> 8. Create the lxc:
>
> lxc-create -n testes -f /path/to/template
>
> 9. start the container:
>
> lxc-start -n testes
>
> 10. update fedora guest to 18
>
> For me the lxc console is useless, so i use ssh to connect to the
> container for any work.
>
>
> On Wed, Feb 6, 2013 at 1:10 PM, Antoine Gaillard
> <antoine.gaillard13 at gmail.com> wrote:
>>
> Le 06/02/2013 08:53, Cristian Falcas a ←crit :
> >>> you need the staging git for fedora 18 guests.
> I'm afraid I didn't make myself clear, I was actually talking about fedora
> host not guest.
>
> Regards,
>
> Antoine GAILLARD.
>>

Ok I'll give it a try. Thanks a lot.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
 
iQIcBAEBCgAGBQJREn7QAAoJEErsvXVG0x582F4QAL8xQIrNxrBFsbToZEas3FLA
QH0nUQrTzckeGu6eX9mSuQg2HVfD+Xnm85zloo5wNQn6XCSRhfRcenrmR1V2AUzg
zIIXR5U4cswGgBOfCRreFMCsfxKw4Xa0sHP/0poDoS2S/44T7jCUF12q9tEvJChL
NffELXgmZPV7vatanmeWocowHnzz2pC89UfBZzy4cPMBtstKRMEdtXnCx3WwhIjH
UBwdNUinJ5s7F9bim0swO4/qupjoZdmzK4erY2e+onwLqiwbpXz8O1qbxPictm3G
0sBdFVuCHK1DBwLnPMBLmROY83ghVt5ataoswCrGJoERpvm0on6fdbT5+X0wpdXB
WMGlsbLrV+cQ5LzesS8919nXuhuvlhITAmJssSGkbhaq1xzI6jJ6YGSB9Nwou4IN
LHBWkGEDQmWS9PlrZ1jLParikhyPjrIuJrjPoVixmRDT0bhH7NzfpMjIixpFAvaU
kj3TH7miy9IS/g9b8IgMw8UFK4rvcGcefS5jnUL8w3jyucJdQH+SNEjy4Vmdslnc
kjhgKoBVGnRIWBvmzwcRysC6ECttxoGjs1ii5wufrFSDhyOh5Q/tiM1zm+ddtICU
WAeUkuG/1kice+FEfChesrmqa3/MgFHsJnVlm8eP5E9oaxQLYHkm3UsFKNQTMKrN
ynmvqMEQvogAo2Qc3/Hn
=tv8f
-----END PGP SIGNATURE-----

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20130206/e295ffd2/attachment.html>


More information about the lxc-users mailing list