Gentoo Archives: gentoo-dev

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Creating development virtual machine
Date: Sun, 21 Aug 2016 04:02:44
Message-Id: robbat2-20160821T034042-069988592Z@orbis-terrarum.net
In Reply to: Re: [gentoo-dev] Creating development virtual machine by Daniel Campbell
1 On Sat, Aug 20, 2016 at 05:15:13PM -0700, Daniel Campbell wrote:
2 > ready-to-go Gentoo installs that come with some needed
3 > software.
4 Release Engineering does already publish cloud-ready stage4 tarballs.
5
6 In the very near future, I intend to for releng/infra to be publishing
7 the pre-converted qcow2 images, but for the moment, you can convert them
8 yourselves:
9
10 1. Grab a cloud stage4:
11 $ curl http://distfiles.gentoo.org/releases/amd64/autobuilds/current-stage4-amd64-hardened+cloud/stage4-amd64-hardened+cloud-20160811.tar.bz2
12
13 2. emerge app-emulation/diskimage-builder
14
15 3. symlink the tarball as needed:
16 $ ln -s stage4-amd64-hardened+cloud-20160811.tar.bz2 gentoo-stage4-hardened.tar.bz2
17
18 4. Convert it to a QCOW2 disk image:
19 $ GENTOO_PROFILE=hardened/linux/amd64 \
20 DIB_IMAGE_CACHE=`pwd` disk-image-create \
21 --offline \
22 --image-size 2 \
23 --mkfs-options='-T news,floppy' \
24 gentoo vm
25
26 5. Use image.qcow2 in the dir to boot the VM, either with cloud-init to
27 inject a root password/ssh keys, or modify the image yourself first
28 (convert to raw format, loopmount w/ -o offset=$((1024*1024)), convert
29 back to QCOW2 afterwards).
30
31 6. You'll want to look at growpart and related tools if you intend to
32 having space to work on stuff on the VM; it's deliberately very small,
33 and I'd like to shave a little more space off to fit into a 1GiB disk
34 with more room to spare.
35
36 ** Right now:
37 - 1GiB volume w/ ~50MiB free
38 - 2GiB volume w/ ~1050MiB free
39 - 1536MiB volume w/ ~679MiB free
40
41
42 --
43 Robin Hugh Johnson
44 Gentoo Linux: Dev, Infra Lead, Foundation Trustee & Treasurer
45 E-Mail : robbat2@g.o
46 GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
47 GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136

Attachments

File name MIME type
signature.asc application/pgp-signature