Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Mar 2018 22:53:32 +0000
From:      =?UTF-8?B?S2FtaWxhIFNvdcSNa292w6E=?= <kamila@ksp.sk>
To:        Allan Jude <allanjude@freebsd.org>, freebsd-rwg@pdx.rh.cn85.dnsmgr.net,  knezour@weboutsourcing.cz
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Easiest way to get a small VM disk image?
Message-ID:  <CAO7yDHpcLPZybEFjC6hd7TWrAdkz6FcvvS1ikYYrZT3CoTfP=g@mail.gmail.com>
In-Reply-To: <06bdc144-1cbd-c6e8-3a7c-f7110627a1d4@freebsd.org>
References:  <CAO7yDHrMqj%2B2r23zaHRP9YyvX9DBmV5WnpOFZGf2NtayQ%2BAc-Q@mail.gmail.com> <06bdc144-1cbd-c6e8-3a7c-f7110627a1d4@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Big thank you to everyone, your suggestions have been very informative! I
will go with Allan's solution, as it is simple and should work for future
releases too. If you happen to need an OpenNebula image, let me know :-)

Best,
Kamila

On Fri, Mar 23, 2018 at 8:47 PM Allan Jude <allanjude@freebsd.org> wrote:

> On 03/23/2018 11:42, Kamila Sou=C4=8Dkov=C3=A1 wrote:
> > Hello,
> >
> > I want to build an OpenNebula[1]-compatible VM image of FreeBSD 11.1. O=
ne
> > requirement for my use case is that the image should initially be small
> > (not as in "take up little physical space", but as in "the size of the
> > virtual disk as visible in the VM should be small". Specifically, I wan=
t
> > the virtual disk size to be no more than 3GB (which should not be a
> > problem, as the default installation of FreeBSD takes a lot less than
> 3G).
> >
> > The VM images available in the official downloads have a virtual size o=
f
> > 20GB. Therefore I need to somehow build my own image (or shrink the
> > existing ones). Here are the approaches I have thought about:
> >
> > - Create and partition an empty disk image, rsync the contents of the
> > official image into it. Problems: AFAIK requires a FreeBSD host to buil=
d
> > (in order to be able to create a UFS filesystem); requires juggling
> around
> > with loopback mounts and such. Probably still the most feasible option,
> but
> > I am not sure, which is why I'm asking.
> > - Create an empty image, boot it in a VM and install from an installati=
on
> > ISO. Problem: not sure how to automate; might not get 1:1 parity with t=
he
> > official VM image
> > - Somehow shrink the existing image. Problem: How?
> > - Find out how the official images are built and do that with a smaller
> > size. This is where this list comes in :-)
> >
> > Which (of these, or any other) is the easiest way to get a small image?
> >
> > Thanks a lot!
> >
> > Kamila
> >
> > [1] https://opennebula.org/
> > _______________________________________________
> > freebsd-hackers@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> > To unsubscribe, send any mail to "
> freebsd-hackers-unsubscribe@freebsd.org"
> >
>
> You should be able to generate a version of the official images easily:
>
> do an svn checkout, then:
>
> make -j <#cpus> buildworld buildkernel
> cd release
> make VMSIZE=3D2944M SWAPSIZE=3D128M VMFORMATS=3Draw DESTDIR=3D/tmp -DNOSR=
C
> -DNOPORTS -DNOPKG -DWITH_VMIMAGES vm-install
>
> Will create the image in /tmp/vmimages
>
> VMFORMATS can also be qcow2, vmdk, or vhd
>
> --
> Allan Jude
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org=
"
>



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