lost and found ( for me ? )

Ubuntu13.04: install FreeBSD 9.2 64bit within KVM

Here are logs when building FreeBSD9.2 VM within KVM.
I am not familiar with FreeBSD, because I mainly use Linux.

I have built the VM by using virt-manager.
BSD 9.x are not in the OS list, so I specified BSD8.x as OS type.

KVM host
root@ubuntu-2:~# tail -1 /etc/lsb-release ;uname -ri
3.8.0-34-generic x86_64
root@ubuntu-2:~# qemu-system-x86_64 --version
QEMU emulator version 1.4.0 (Debian 1.4.0+dfsg-1expubuntu4), Copyright (c) 2003-2008 Fabrice Bellard
root@ubuntu-2:~# libvirtd --version
libvirtd (libvirt) 1.0.2

disk format: qcow2
OS type: BSD8.x
I used FreeBSD-9.2-RELEASE-amd64-dvd1.iso file to install FreeBSD.

installing BSD


get things done!

# uname -a
FreeBSD bsd01.localdomain 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013     root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

execute security update
# freebsd-update fetch
# freebsd-update install

how can I enable serial console to access to the VM via “virsh console”?

add the following line in /boot/defaults/loader.conf
# tail -1 /boot/defaults/loader.conf

edit /etc/ttys
edit ttyu0 line like this:
# egrep ttyu0 /etc/ttys
#ttyu0  "/usr/libexec/getty std.9600"   dialup  off secure
ttyu0   "/usr/libexec/getty std.9600"   vt100   on  secure

reboot the OS
# reboot

connect to the VM over virsh console
virsh # console freebsd92-vm1
FreeBSD/amd64 (bsd01.localdomain) (ttyu0)

login: root
Dec  5 05:33:11 bsd01 login: ROOT LOGIN (root) ON ttyu0

virtio drivers are loading.
# dmesg | grep virtio
virtio_pci0: <VirtIO PCI Balloon adapter> port 0xc060-0xc07f irq 11 at device 4.0 on pci0
vtballoon0: <VirtIO Balloon Adapter> on virtio_pci0
virtio_pci0: host features: 0x71000002 <EventIdx,RingIndirect,NotifyOnEmpty,StatsVq>
virtio_pci0: negotiated features: 0

create one more BSD VM with virt-clone.

at first, shutdown the VM
# shutdown –p now

clone the VM
# virt-clone -o freebsd92-vm1 -n freebsd02-vm2 --file /var/lib/KVM_images/freebsd92-vm2.qcow2
割り当て中 'freebsd92-vm2.qcow2'                    |  20 GB     01:13


boot the cloned VM
# virsh list --all | grep -i bsd
-     freebsd02-vm2                  shut off
-     freebsd92-vm1                  shut off

# virsh start freebsd02-vm2 –console

change hostname
# head -1 /etc/rc.conf

# reboot

how to allow non root user to become root user with su command.
add users in the wheel group
# egrep wheel /etc/group

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.