From owner-freebsd-hackers@freebsd.org Fri Mar 23 22:53:50 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 21F63F52B65 for ; Fri, 23 Mar 2018 22:53:50 +0000 (UTC) (envelope-from kamisouckova@gmail.com) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com [209.85.214.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3B8C69415; Fri, 23 Mar 2018 22:53:49 +0000 (UTC) (envelope-from kamisouckova@gmail.com) Received: by mail-it0-f45.google.com with SMTP id b136-v6so4391569iti.3; Fri, 23 Mar 2018 15:53:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NB9gQCkpoIlKmq2NZWskSQHmmNarxsvIZRIZto88WqU=; b=bou51tcltYOWzNcKlQPB/wYTA/YPs8Ts0y0NLP3xN213DhIdJhJHXsEBhQDra06xaW HBe4Iamj4q7jK7e5VY7Zhsjeh8z7dBgV8P0ws+OBxRaxRzTldl7EFeKUBB0DyM55hyys vVhWnr9GfLP7YRUz4lO+PwkUNGHCUdnXubgJr1Uokr16TTcuUVd4YiS4AowECSx0S2S9 f10t3Y67eOqsyLMPcvF4tJ1CtDcJc1SybpT6BHt7B5W0ixxVmDFwrrvd6jvOPFGXyGnT 2Lg6nBwY2HHaLy9Z3XHLkb9pEEnHRHKYCJQp66zOFJ9//J06xHdk7r8G6lbLmO0XafUH gQ9Q== X-Gm-Message-State: AElRT7G5ZhLxjso+yST15kDLbI4SfrL8ihtFnpMd+/VXpvrfU93CCq5A vYI7PuKR/6R9yUhl+YAiiGnAInbt+k8rkt5pe/KQdw== X-Google-Smtp-Source: AG47ELvMiTdO5++Zw4V7Oa3FYpPagZVnAI/iuFOc5xYhbXezdBW83MLbdzf4IytfYbRAWATHkqu8ysjAFYWCIKOKTqQ= X-Received: by 2002:a24:1ad4:: with SMTP id 203-v6mr15288013iti.18.1521845622897; Fri, 23 Mar 2018 15:53:42 -0700 (PDT) MIME-Version: 1.0 References: <06bdc144-1cbd-c6e8-3a7c-f7110627a1d4@freebsd.org> In-Reply-To: <06bdc144-1cbd-c6e8-3a7c-f7110627a1d4@freebsd.org> From: =?UTF-8?B?S2FtaWxhIFNvdcSNa292w6E=?= Date: Fri, 23 Mar 2018 22:53:32 +0000 Message-ID: Subject: Re: Easiest way to get a small VM disk image? To: Allan Jude , freebsd-rwg@pdx.rh.cn85.dnsmgr.net, knezour@weboutsourcing.cz Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 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 22:53:50 -0000 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 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= " >