BSD · FreeBSD · FreeBSD 10.0 · Image Management

Bundling FreeBSD 10.x image for OpenStack

The following method was tested with FreeBSD 10.0 image bundled into Icehouse version of OpenStack running on Ubuntu 14.04

Create an image needed for Hard-drive emulation

qemu-img create -f qcow2 freebsd.img 5G


Start the Virtual Machine to boot from the CD.

kvm -m 512 -cdrom FreeBSD-10.0-RELEASE-amd64-disc1.iso -drive file=freebsd.img,if=virtio -boot d -net nic -net user -nographic -vnc :1

Connect to the Virtual Machine through VNC (use display number :1) where 10.10.10.1 is the IP address of the host machine.

vncviewer 10.10.10.1 :1

After installation is over, during the post-installation configuration enable SSH server, IPV4 and DHCP. Shutdown the Virtual Machine and use the following command to boot from the hard drive.

kvm -m 1024 -drive file=freebsd.img -boot c -net nic -net user -nographic -vnc :1

Add the following line to /etc/rc.conf

ifconfig_vtnet0="DHCP"

Edit the following lines as below in /etc/ssh/sshd_config, for SSH access as root and to enable password authentication.

PermitRootLogin yes
PasswordAuthentication yes

Do the other necessary changes needed for the image and shutdown the Virtual Machine.

Shutdown the Virtual Machine and upload the image to OpenStack using Horizon or Glance commands.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s