Easiest way to get a small VM disk image?
Ondra Knezour
knezour at weboutsourcing.cz
Fri Mar 23 16:32:54 UTC 2018
Dne 23.03.2018 v 16:42 Kamila Součková napsal(a):
> [...]
> The VM images available in the official downloads have a virtual size of
> 20GB. Therefore I need to somehow build my own image (or shrink the
> existing ones). Here are the approaches I have thought about:
>
> [...]
> - Create an empty image, boot it in a VM and install from an installation
> ISO. Problem: not sure how to automate; might not get 1:1 parity with the
> official VM image
This is way I use. Create VM, install what I want, use as template. For
automation, search firstboot in rc(8) [1] - generally you may want to
delete keys for the sshd daemon to recreate new ones for each VM, maybe
set hostname and/or IP addresses if not provided by DHCP etc.
> - Somehow shrink the existing image. Problem: How?
AFAIK there is no way to shrink a UFS partition. Only create new one,
smaller and dump & restore.
> - Find out how the official images are built and do that with a smaller
> size. This is where this list comes in :-)
See the FreeBSD Release Engineering article [2] and release(7) [3] man
page. Search VMFORMATS and/or CLOUDWARE on the later one.
There are also other tools which may give you some insight how can be
FreeBSD image building customized, search Google for nanobsd, picobsd,
chrochet, freebsd wifi build
>
> Which (of these, or any other) is the easiest way to get a small image?
[1]
https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=8&manpath=FreeBSD+11.1-RELEASE&arch=default&format=html
[2]https://www.freebsd.org/doc/en_US.ISO8859-1/articles/releng/article.html#release-build
[3]
https://www.freebsd.org/cgi/man.cgi?query=release&apropos=0&sektion=0&manpath=FreeBSD+11.1-RELEASE&arch=default&format=html#end
--
S pozdravem
Ondra Knezour
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4541 bytes
Desc: Elektronicky podpis S/MIME
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20180323/bf9244a8/attachment.bin>
More information about the freebsd-hackers
mailing list