Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 May 2010 21:15:37 +0000 (GMT)
From:      "Alexandre L." <axelbsd@ymail.com>
To:        freebsd-questions <freebsd-questions@FreeBSD.ORG>, Yuri <yuri@rawbw.com>
Subject:   Re : Possible to run Linux distro in a jail?
Message-ID:  <533379.74324.qm@web24819.mail.ird.yahoo.com>

next in thread | raw e-mail | index | archive | help
I have this link to a French Blog : http://blog.etoilebsd.net/post/Emprison=
ner_une_debian_dans_un_FreeBSD=0A=0AThis describe how to "jail" a Linux Deb=
ian in FreeBSD.=0A=0AI hope this will help you. I haven't used it. =0AThank=
s to its author : Baptiste Daroussin.=0A=0AI translated it in English : =0A=
=0A<<<<<<<<<=0A=0A# mkdir /home/jails/debian=0A# mkdir /home/jails/debian/d=
ev=0A# mkdir /home/jails/debian/proc=0A# mkdir /home/jails/debian/sys=0A# k=
ldload linux=0A# kldload linprocfs=0A# kldload linsysfs=0A# kldload lindev=
=0A# mount -t devfs none /home/jails/debian/dev=0A# mount -t linprocfs none=
 /home/jails/debian/proc=0A# mount -t linsysfs none /home/jails/debian/sys=
=0A=0AWe are using /home/jails/debian for the root of the Linux Debian.=0AW=
e will load all the necessary devices (nota : lindev appeared in Freebsd 9-=
CURRENT and has MFCed in 8-STABLE, it is not obligatory).=0A=0AWe could do =
the install with debootstrap, but I prefered to use an openvz template : =
=0A# fetch http://download.openvz.org/template/precreated/debian-5.0-x86.ta=
r.gz=0A=0AAnd I unpack it in my jail : =0A# tar xvfp debian-5.0-x86.tar.gz =
-C debian --exclude dev* --exclude proc* --exclude sys*=0A=0ATo correctly s=
tart my jail, at least 1 service must be started in the jail (I failed to b=
uild a persistent linux jail only). By default the startup script of jails =
try to launch /etc/rc that we will create and launch /etc/rc.shutdown to st=
op it.=0A=0A# echo "/etc/init.d/cron start" > /home/jails/debian/etc/rc=0A#=
 chmod 755 /home/jails/debian/etc/rc=0A# echo "/etc/init.d/cron stop" > /ho=
me/jails/debian/etc/rc.shutdown=0A# chmod 755 /home/jails/debian/etc/rc.shu=
tdown=0A=0AIn /etc/rc.conf we configure the startup of the jail : =0Ajail_d=
ebian_rootdir=3D/home/jails/debian=0Ajail_debian_hostname=3D"debian"=0Ajail=
_debian_ip=3D"192.168.1.3"=0Ajail_debian_interface=3D"nfe0"=0Ajail_debian_d=
evfs_enable=3D"YES"=0Ajail_debian_devfs_ruleset=3D"devfsrules_jail"=0Ajail_=
debian_flags=3D"-n debian"=0A=0AWe start the jail : =0A# /etc/rc.d/jail sta=
rt debian=0A=0AAnd voil=E0 : =0A#jls=0A   JID  IP Address      Hostname    =
                  Path=0A    15  192.168.1.3     debian                    =
    /home/jails/debian=0A#jexec debian uname -a=0ALinux debian 2.6.16 FreeB=
SD 8.0-STABLE #3: Sun Jan 10 20:39:38 CET 2010 i686 GNU/Linux=0A#jexec debi=
an cat /etc/debian_version=0A5.0.4=0A=0AHere a beautiful Debian Linux jaile=
d in FreeBSD=0ABut be careful, not everything works perfectly : sysklogd do=
n't run cause to /dev access. But 99% is functional.=0A=0A--- En date de=A0=
: Ven 28.5.10, Yuri <yuri@rawbw.com> a =E9crit=A0:=0A=0A> De: Yuri <yuri@ra=
wbw.com>=0A> Objet: Possible to run Linux distro in a jail?=0A> =C0: "freeb=
sd-questions" <freebsd-questions@FreeBSD.ORG>=0A> Date: Vendredi 28 mai 201=
0, 20h16=0A> When I googled "linux in a jail" I=0A> got some references but=
 no particular howto.=0A> Since currently VirtualBox is broken (hangs OS af=
ter a=0A> while), is it really possible to install Linux into a jail=0A> as=
 a virtual machine?=0A> =0A> Yuri=0A> _____________________________________=
__________=0A> freebsd-questions@freebsd.org=0A> mailing list=0A> http://li=
sts.freebsd.org/mailman/listinfo/freebsd-questions=0A> To unsubscribe, send=
 any mail to "freebsd-questions-unsubscribe@freebsd.org"=0A>=0A=0A=0A=0A   =
   




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?533379.74324.qm>