Skip to content

Instantly share code, notes, and snippets.

@kikitux
Created December 30, 2013 06:49
Show Gist options
  • Save kikitux/8178674 to your computer and use it in GitHub Desktop.
Save kikitux/8178674 to your computer and use it in GitHub Desktop.
[root@vagrant-oracle65 ~]# rm -fr /var/cache/
[root@vagrant-oracle65 ~]# lxc-create -n mygentoo3 -t gentoo -- --autologin
lxc-create: No config file specified, using the default config /etc/lxc/default.conf
### set_default_arch: default arch/variant autodetect...
=> Got: arch=amd64 variant=amd64
Attempting to obtain an exclusive lock (timeout: 60 sec) named "cache-amd64-amd64"...
=> done.
=> Executing "do_all"
###### cache_setup(): doing cache preparation
### cache_precheck(): doing some pre-start checks ...
### cache_stage3(): stage3 cache deployment...
Determining path to latest Gentoo amd64 (amd64) stage3 archive...
=> downloading and processing http://distfiles.gentoo.org/releases/amd64/autobuilds/latest-stage3-amd64.txt
=> Got: 20131226/stage3-amd64-20131226.tar.bz2
Downloading/untarring the actual stage3 tarball...
--2013-12-30 19:18:49-- http://distfiles.gentoo.org/releases/amd64/autobuilds/20131226/stage3-amd64-20131226.tar.bz2
Resolving distfiles.gentoo.org... 64.50.233.100, 140.211.166.134, 156.56.247.195, ...
Connecting to distfiles.gentoo.org|64.50.233.100|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 177921008 (170M) [application/x-bzip2]
Saving to: “STDOUT”
100%[==============================================================================================================================>] 177,921,008 306K/s in 11m 10s
2013-12-30 19:30:05 (259 KB/s) - written to stdout [177921008/177921008]
=> extracted to: /var/cache/lxc/gentoo/partial-amd64-amd64
chroot test... OK
=> stage3 cache extracted in : /var/cache/lxc/gentoo/partial-amd64-amd64
### cache_portage: caching portage tree tarball...
Downloading Gentoo portage (software build database) snapshot...
Attempting to obtain an exclusive lock (timeout: 60 sec) named "portage"...
=> done.
=> Executing "wget -O /var/cache/lxc/gentoo/portage.tbz http://distfiles.gentoo.org/snapshots/portage-latest.tar.bz2"
--2013-12-30 19:30:06-- http://distfiles.gentoo.org/snapshots/portage-latest.tar.bz2
Resolving distfiles.gentoo.org... 216.165.129.135, 64.50.236.52, 64.50.233.100, ...
Connecting to distfiles.gentoo.org|216.165.129.135|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 68359311 (65M) [application/x-bzip2]
Saving to: “/var/cache/lxc/gentoo/portage.tbz”
100%[==============================================================================================================================>] 68,359,311 152K/s in 6m 25s
2013-12-30 19:36:37 (173 KB/s) - “/var/cache/lxc/gentoo/portage.tbz” saved [68359311/68359311]
=> done.
### cache_inittab: tuning inittab...
### cache_net: doing some useful net tuning...
### cache_dev(): /dev tuning...
### cache_openrc(): doing openrc tuning
###### cache_setup: Cache should be ready
##### container_setup(): starting container setup
### container_precheck(): doing some pre-start checks ...
#### container_rootfs(): copying rootfs /container/mygentoo3/rootfs from cache /var/cache/lxc/gentoo/rootfs-amd64-amd64 ...
chroot test... OK
=> done
#### container_tz(): setting container timezone ...
=> host localtime copyed to container
#### container_portage(): setting container portage...
Warnings are normal here, don't worry
!!! Section 'x-portage' in repos.conf has location attribute set to nonexistent directory: '/usr/portage'
!!! Section 'gentoo' in repos.conf has location attribute set to nonexistent directory: '/usr/portage'
!!! Invalid Repository Location (not a dir): '/usr/portage'
!!! Section 'x-portage' in repos.conf has location attribute set to nonexistent directory: '/usr/portage'
!!! Section 'gentoo' in repos.conf has location attribute set to nonexistent directory: '/usr/portage'
!!! Invalid Repository Location (not a dir): '/usr/portage'
trying to guess portage_dir from host...
/usr/share/lxc/templates/lxc-gentoo: line 386: portageq: command not found
=> host portage detection failed (not gentoo host), fallback to private portage tree
# untaring private portage to /container/mygentoo3/rootfs//usr/portage from /var/cache/lxc/gentoo/portage.tbz ...
Attempting to obtain an exclusive lock (timeout: 60 sec) named "portage"...
=> done.
=> Executing "tar -xp --strip-components 1 -C /container/mygentoo3/rootfs//usr/portage -f /var/cache/lxc/gentoo/portage.tbz"
=> done
container_net(): setting container network conf...
* service net.eth0 added to runlevel default
=> network conf done.
#### container_hostname(): setting hostname...
=> done.
#### container_auth(): setting authentification...
=> Autologin on main console for root enabled
=> done.
container_configuration(): making lxc configuration file...
=> done.
###### container_setup(): container should be ready to start!
You could now use you container with: lxc-start -n mygentoo3
=> rootfs of container is : /container/mygentoo3/rootfs
=> timezone was staticly copyed from host
=> container has its own portage tree at /usr/portage
=> Connection user is root
=> root has autologin on main console
'gentoo' template installed
'mygentoo3' created
[root@vagrant-oracle65 ~]# lxc-start -n mygentoo3
INIT: version 2.88 booting
OpenRC 0.12.4 is starting up Gentoo Linux (x86_64)
* Mounting /proc ... [ ok ]
* Mounting /run ... * /run/openrc: creating directory
* /run/lock: creating directory
* /run/lock: correcting owner
* Caching service dependencies ... [ ok ]
* Mounting /dev/mqueue ... [ ok ]
* Mounting /dev/shm ... [ ok ]
* setting up tmpfiles.d entries for /dev ... [ ok ]
* Creating user login records ... [ ok ]
* Wiping /tmp directory ... [ ok ]
* Bringing up network interface lo ... [ ok ]
* Updating /etc/mtab ... [ ok ]
* setting up tmpfiles.d entries ... [ ok ]
INIT: Entering runlevel: 3
* Bringing up interface eth0
* Caching network module dependencies
need firewalld
* dhcp ... * Running udhcpc ... [ ok ]
* received address 192.168.122.219/24
[ ok ]
* Starting local
[ ok ]
This is mygentoo3. (Linux x86_64 3.8.13-16.3.1.el6uek.x86_64) 19:49:21
mygentoo3 login: root (automatic login)
mygentoo3 ~ #
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment