How to make a FreeBSD vm in virtualbox.

Glen Barber gjb at FreeBSD.org
Wed Dec 31 15:17:36 UTC 2014


On Tue, Dec 30, 2014 at 10:04:38PM -0800, Alfred Perlstein wrote:
> 
> On Dec 30, 2014, at 8:24 PM, Glen Barber wrote:
> 
> > On Tue, Dec 30, 2014 at 07:42:36PM -0800, Alfred Perlstein wrote:
> >> After he linked it to me, I decided that it would make sense if
> >> this was scripted and would really make sense as part of the release
> >> process.
> >> 
> > 
> > We already provide VMDK images.  There is nothing, that I can see, that
> > is different from how I've been testing the various images.  Creating
> > a new VM and attaching the VMDK to the disk controller is the intended
> > workflow.
> 
> The difference is that with a vmdk you must get the exact
> combinations of items correct or you will wind up with a FreeBSD
> instance that will not boot.  With the ova, you just run a single
> command "VBoxManage FreeBSD.ova" and stuff "just works", or you can
> even just double click on the downloaded file from within your OS
> X / Windows/ whatever host and it "just works".
> 
> 
> > 
> >> I've written a script that will make a .ova that you can one-click
> >> import into Virtualbox (and I think Fusion as well) here:
> >> 
> >>  https://gist.github.com/splbio/84bd4d2122782e99fc5c
> >> 
> > 
> > Can you send the script as an attachment?
> 
> Uh sure.  It's attached.
> 

Your script relies on VirtualBox being installed on the build machine,
which I do not like.  This is one of the major reasons I'm happy Marcel
added VMDK support to mkimg(1) - all the components to create the
formatted disk image exist in the base system.

> >> What is the best way to get this made into part of the release
> >> process so that we can get .ovas shipped as well.
> >> 
> > 
> > I'm inclined to think this is an overkill solution, to be honest.
> 
> Here is why I strongly disagree.
> 
> Creating a proper .ova is fraught with small errors that easily
> turn users away.
> 

Such as?

> The most simple thing, accidentally picking 32bit BSD, has bitten
> many a newcomer and just makes things unpleasant.
> 

Isn't the default FreeBSD version in VirtualBox still the 32-bit
version?

> Please read through the blog post by Ryan on the EXACT config
> needed for FreeBSD to work correctly:
> 

I did.

> It's tiring, long and easy to get wrong. 
> 
> By reducing steps we make it easier for people to use FreeBSD in
> a virtual environment.
> 

What we need, then, is a utility to create the ova.xml file from the
specified disk image.

I strongly oppose depending on building VirtualBox (which has
implications of its own) for producing VM images, especially when the
disk image can be created using base utilities alone.  Given that,
relying on a third-party utility is a step backwards.

> > 
> >> One final question, is there a possibility we could add some
> >> changes to the image so that it auto-dhcp's an address?  Most people
> >> who just download the image won't know to "dhclient em0" or even
> >> what an "em0" is.
> >> 
> > 
> > I think 'ifconfig_DEFAULT="DHCP"' in rc.conf(5) is what you want.
> 
> Do we want this by default in all images?  (I would vote yes).
> 

I'd actually argue 'no.'  As a sysadmin, I don't want any system doing
anything I don't expect it to do, virtual machine or not.

Glen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20141231/249c4260/attachment.sig>


More information about the freebsd-hackers mailing list