From owner-freebsd-hackers@freebsd.org Fri Mar 23 19:43:27 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66C80F68804 for ; Fri, 23 Mar 2018 19:43:27 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10B2D88BE1 for ; Fri, 23 Mar 2018 19:43:26 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from Ticonderoga.HML3.ScaleEngine.net (senat1-01.HML3.ScaleEngine.net [209.51.186.5]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 6841014415; Fri, 23 Mar 2018 19:43:20 +0000 (UTC) Subject: Re: Easiest way to get a small VM disk image? To: freebsd-hackers@freebsd.org References: Cc: =?UTF-8?B?S2FtaWxhIFNvdcSNa292w6E=?= From: Allan Jude Message-ID: <06bdc144-1cbd-c6e8-3a7c-f7110627a1d4@freebsd.org> Date: Fri, 23 Mar 2018 15:43:19 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2018 19:43:27 -0000 On 03/23/2018 11:42, Kamila Součková wrote: > Hello, > > I want to build an OpenNebula[1]-compatible VM image of FreeBSD 11.1. One > 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 want > 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 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 and partition an empty disk image, rsync the contents of the > official image into it. Problems: AFAIK requires a FreeBSD host to build > (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 installation > ISO. Problem: not sure how to automate; might not get 1:1 parity with the > 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=2944M SWAPSIZE=128M VMFORMATS=raw DESTDIR=/tmp -DNOSRC -DNOPORTS -DNOPKG -DWITH_VMIMAGES vm-install Will create the image in /tmp/vmimages VMFORMATS can also be qcow2, vmdk, or vhd -- Allan Jude