kvm1 - generic FreeBSD test machine
guest os: FreeBSD/amd64
cpu: 1
memory size: 512 MB
storage: file - 8 GB (was: 6 GB)
IP address: 192.168.122.166
back to virtual machines page.
Links
Links: Speeding up builds on FreeBSD,
History / work log
2017-10-10: kvm1 - ssh to the machine
tingo@kg-vm4:~$ ssh tingo@192.168.122.166 Password for tingo@kvm1.local: Last login: Mon Oct 9 19:37:59 2017 FreeBSD 10.4-STABLE (GENERIC) #4 r324416: Mon Oct 9 23:52:05 CEST 2017 Welcome to FreeBSD! ********************************* * * * kvm1 * * * ********************************* To see the 10 largest files on a directory or partition, use du /partition_or_directory_name | sort -rn | head -- Dru <genesis@istar.ca> tingo@kvm1$
yep, works.
2017-10-10: vm4 - start kvm1
tingo@kg-vm4:~$ virsh --connect qemu:///system start kvm1 Domain kvm1 started
ok, verify
tingo@kg-vm4:~$ virsh --connect qemu:///system list Id Name State ---------------------------------------------------- 38 kvm2 running 39 kvm1 running
both are running.
2017-10-10: vm4 - it seems that bug 213155 is at work here, so let me see if I can do a workaround.
using dumpxml: $ virsh --connect qemu:///system dumpxml kvm1
it seems like this block
<cpu mode='host-model'> <model fallback='allow'/> </cpu>
must be replaced with this block (from kvm2 - $ virsh --connect qemu:///system dumpxml kvm2)
<cpu mode='custom' match='exact'> <model fallback='forbid'>Opteron_G3</model> </cpu>
so let me see if I can edit the domain
tingo@kg-vm4:~$ virsh --connect qemu:///system edit kvm1
(edit with vi)
tingo@kg-vm4:~$ virsh --connect qemu:///system dumpxml kvm2 | grep "cpu mode" <cpu mode='custom' match='exact'> tingo@kg-vm4:~$ virsh --connect qemu:///system dumpxml kvm1 | grep "model fallback" <model fallback='forbid'>Opteron_G3</model>
looks better. Now, try to boot it.
2017-10-09: kvm1 - make world again
root@kvm1# cd /usr/src root@kvm1# make buildworld [..] -------------------------------------------------------------- >>> World build completed on Mon Oct 9 21:25:48 CEST 2017 --------------------------------------------------------------
kernel - build and install
root@kvm1# make kernel [..] install -o root -g wheel -m 555 iscsi_initiator.ko /boot/kernel install -o root -g wheel -m 555 iscsi_initiator.ko.symbols /boot/kernel kldxref /boot/kernel
mergemaster PRE
root@kvm1# mergemaster -p [..]
install world
root@kvm1# make installworld [..] install -s -o root -g wheel -m 555 ldd32 /usr/bin/ldd32
delete old stuff
root@kvm1# make delete-old >>> Removing old files (only deletes safe to delete libs) >>> Old files removed >>> Removing old directories /usr/share/doc/atf /usr/share/atf /usr/include/atf-c++ /usr/include/atf-c >>> Old directories removed To remove old libraries run 'make delete-old-libs'. root@kvm1# make delete-old-libs >>> Removing old libraries Please be sure no application still uses those libraries, else you can not start such an application. Consult UPDATING for more information regarding how to cope with the removal/revision bump of a specific library. >>> Old libraries removed
mergemaster
root@kvm1# mergemaster -iUP [..] *** Reinstalling Europe/Oslo as /etc/localtime
and done.
2017-10-09: kvm1 - rename the working kernel so we have it:
root@kvm1# pwd /boot root@kvm1# mv kernel.old kernel_10.3
and retry make world.
2017-10-09: kvm1 - ok, it boots from the old kernel
load /boot/kernel.old/kernel boot
so something is wrong with the new one.
2017-10-09: vm4 - destroy the domain and start it again
tingo@kg-vm4:~$ virsh --connect qemu:///system destroy kvm1 Domain kvm1 destroyed tingo@kg-vm4:~$ virsh --connect qemu:///system start kvm1 Domain kvm1 started
unfortunately, it hangs (after loading kernel and virtio_console module) again.
2017-10-09: kvm1 - I rebooted via 'shutdown -r now', unfortunately the machine hun while booting (I had to run virt-viewer to see boot console)
2017-10-09: kvm1 - return to out make build procedure
make installworld again
root@kvm1# make installworld [..] install -s -o root -g wheel -m 555 ldd32 /usr/bin/ldd32
delete old stuff
root@kvm1# make delete-old >>> Removing old files (only deletes safe to delete libs) remove /usr/share/man/man2/cap_rights_get.2.gz? y remove /usr/share/man/man4/hv_ata_pci_disengage.4.gz? y remove /usr/share/man/man9/rman_await_resource.9.gz? y >>> Old files removed >>> Removing old directories /usr/share/doc/atf /usr/share/atf /usr/include/atf-c++ /usr/include/atf-c >>> Old directories removed To remove old libraries run 'make delete-old-libs'. root@kvm1# make delete-old-libs >>> Removing old libraries Please be sure no application still uses those libraries, else you can not start such an application. Consult UPDATING for more information regarding how to cope with the removal/revision bump of a specific library. >>> Old libraries removed
run mergemaster
root@kvm1# mergemaster -iUP [..] *** You chose the automatic install option for files that did not exist on your system. The following were installed for you: /etc/rc.d/zfsbe *** You chose the automatic upgrade option for files that you did not alter on your system. The following were upgraded for you: /.cshrc /COPYRIGHT /boot/device.hints /etc/amd.map /etc/apmd.conf /etc/auto_master /etc/autofs/include_ldap /etc/autofs/special_hosts /etc/autofs/special_media /etc/autofs/special_noauto /etc/autofs/special_null /etc/bluetooth/hcsecd.conf /etc/bluetooth/hosts /etc/bluetooth/protocols /etc/crontab /etc/csh.cshrc /etc/csh.login /etc/csh.logout /etc/ddb.conf /etc/defaults/bluetooth.device.conf /etc/defaults/devfs.rules /etc/defaults/periodic.conf /etc/defaults/rc.conf /etc/devd.conf /etc/devd/asus.conf /etc/devd/hyperv.conf /etc/devd/uath.conf /etc/devd/usb.conf /etc/devd/zfs.conf /etc/devfs.conf /etc/dhclient.conf /etc/disktab /etc/fbtab /etc/freebsd-update.conf /etc/ftpusers /etc/gettytab /etc/gss/mech /etc/gss/qop /etc/hosts /etc/hosts.allow /etc/hosts.equiv /etc/hosts.lpd /etc/inetd.conf /etc/libalias.conf /etc/libmap.conf /etc/libmap32.conf /etc/locate.rc /etc/login.access /etc/login.conf /etc/mac.conf /etc/mail/Makefile /etc/mail/README /etc/mail/access.sample /etc/mail/aliases /etc/mail/freebsd.mc /etc/mail/freebsd.submit.mc /etc/mail/mailer.conf /etc/mail/mailertable.sample /etc/mail/virtusertable.sample /etc/mtree/BSD.debug.dist /etc/mtree/BSD.include.dist /etc/mtree/BSD.root.dist /etc/mtree/BSD.sendmail.dist /etc/mtree/BSD.usr.dist /etc/mtree/BSD.var.dist /etc/netconfig /etc/netstart /etc/network.subr /etc/networks /etc/newsyslog.conf /etc/nscd.conf /etc/nsmb.conf /etc/nsswitch.conf /etc/ntp.conf /etc/ntp/leap-seconds /etc/opieaccess /etc/pam.d/README /etc/pam.d/atrun /etc/pam.d/cron /etc/pam.d/ftp /etc/pam.d/ftpd /etc/pam.d/imap /etc/pam.d/login /etc/pam.d/other /etc/pam.d/passwd /etc/pam.d/pop3 /etc/pam.d/rsh /etc/pam.d/sshd /etc/pam.d/su /etc/pam.d/system /etc/pam.d/telnetd /etc/pam.d/xdm /etc/pccard_ether /etc/periodic/daily/100.clean-disks /etc/periodic/daily/110.clean-tmps /etc/periodic/daily/120.clean-preserve /etc/periodic/daily/130.clean-msgs /etc/periodic/daily/140.clean-rwho /etc/periodic/daily/150.clean-hoststat /etc/periodic/daily/200.backup-passwd /etc/periodic/daily/210.backup-aliases /etc/periodic/daily/300.calendar /etc/periodic/daily/310.accounting /etc/periodic/daily/330.news /etc/periodic/daily/400.status-disks /etc/periodic/daily/401.status-graid /etc/periodic/daily/404.status-zfs /etc/periodic/daily/406.status-gmirror /etc/periodic/daily/407.status-graid3 /etc/periodic/daily/408.status-gstripe /etc/periodic/daily/409.status-gconcat /etc/periodic/daily/420.status-network /etc/periodic/daily/430.status-rwho /etc/periodic/daily/440.status-mailq /etc/periodic/daily/450.status-security /etc/periodic/daily/460.status-mail-rejects /etc/periodic/daily/480.leapfile-ntpd /etc/periodic/daily/480.status-ntpd /etc/periodic/daily/500.queuerun /etc/periodic/daily/510.status-world-kernel /etc/periodic/daily/800.scrub-zfs /etc/periodic/daily/999.local /etc/periodic/monthly/200.accounting /etc/periodic/monthly/450.status-security /etc/periodic/monthly/999.local /etc/periodic/security/100.chksetuid /etc/periodic/security/110.neggrpperm /etc/periodic/security/200.chkmounts /etc/periodic/security/300.chkuid0 /etc/periodic/security/400.passwdless /etc/periodic/security/410.logincheck /etc/periodic/security/500.ipfwdenied /etc/periodic/security/510.ipfdenied /etc/periodic/security/520.pfdenied /etc/periodic/security/550.ipfwlimit /etc/periodic/security/610.ipf6denied /etc/periodic/security/700.kernelmsg /etc/periodic/security/800.loginfail /etc/periodic/security/900.tcpwrap /etc/periodic/security/security.functions /etc/periodic/weekly/310.locate /etc/periodic/weekly/320.whatis /etc/periodic/weekly/330.catman /etc/periodic/weekly/340.noid /etc/periodic/weekly/450.status-security /etc/periodic/weekly/999.local /etc/pf.os /etc/phones /etc/pkg/FreeBSD.conf /etc/portsnap.conf /etc/ppp/ppp.conf /etc/printcap /etc/protocols /etc/rc /etc/rc.bsdextended /etc/rc.d/DAEMON /etc/rc.d/FILESYSTEMS /etc/rc.d/LOGIN /etc/rc.d/NETWORKING /etc/rc.d/SERVERS /etc/rc.d/abi /etc/rc.d/accounting /etc/rc.d/addswap /etc/rc.d/adjkerntz /etc/rc.d/amd /etc/rc.d/apm /etc/rc.d/apmd /etc/rc.d/archdep /etc/rc.d/atm1 /etc/rc.d/atm2 /etc/rc.d/atm3 /etc/rc.d/auditd /etc/rc.d/auditdistd /etc/rc.d/automount /etc/rc.d/automountd /etc/rc.d/autounmountd /etc/rc.d/bgfsck /etc/rc.d/bluetooth /etc/rc.d/bootparams /etc/rc.d/bridge /etc/rc.d/bsnmpd /etc/rc.d/bthidd /etc/rc.d/ccd /etc/rc.d/cleanvar /etc/rc.d/cleartmp /etc/rc.d/cron /etc/rc.d/ctld /etc/rc.d/ddb /etc/rc.d/defaultroute /etc/rc.d/devd /etc/rc.d/devfs /etc/rc.d/dhclient /etc/rc.d/dmesg /etc/rc.d/dumpon /etc/rc.d/faith /etc/rc.d/fsck /etc/rc.d/ftp-proxy /etc/rc.d/ftpd /etc/rc.d/gbde /etc/rc.d/geli /etc/rc.d/geli2 /etc/rc.d/gptboot /etc/rc.d/growfs /etc/rc.d/gssd /etc/rc.d/hastd /etc/rc.d/hcsecd /etc/rc.d/hostapd /etc/rc.d/hostid /etc/rc.d/hostid_save /etc/rc.d/hostname /etc/rc.d/inetd /etc/rc.d/initrandom /etc/rc.d/ip6addrctl /etc/rc.d/ipfilter /etc/rc.d/ipfs /etc/rc.d/ipfw /etc/rc.d/ipmon /etc/rc.d/ipnat /etc/rc.d/ipropd_master /etc/rc.d/ipropd_slave /etc/rc.d/ipsec /etc/rc.d/ipxrouted /etc/rc.d/iscsictl /etc/rc.d/iscsid /etc/rc.d/jail /etc/rc.d/kadmind /etc/rc.d/kdc /etc/rc.d/keyserv /etc/rc.d/kfd /etc/rc.d/kld /etc/rc.d/kldxref /etc/rc.d/kpasswdd /etc/rc.d/ldconfig /etc/rc.d/local /etc/rc.d/local_unbound /etc/rc.d/localpkg /etc/rc.d/lockd /etc/rc.d/lpd /etc/rc.d/mdconfig /etc/rc.d/mdconfig2 /etc/rc.d/mixer /etc/rc.d/motd /etc/rc.d/mountcritlocal /etc/rc.d/mountcritremote /etc/rc.d/mountd /etc/rc.d/mountlate /etc/rc.d/moused /etc/rc.d/mroute6d /etc/rc.d/mrouted /etc/rc.d/msgs /etc/rc.d/natd /etc/rc.d/netif /etc/rc.d/netoptions /etc/rc.d/netwait /etc/rc.d/newsyslog /etc/rc.d/nfscbd /etc/rc.d/nfsclient /etc/rc.d/nfsd /etc/rc.d/nfsuserd /etc/rc.d/nisdomain /etc/rc.d/nscd /etc/rc.d/nsswitch /etc/rc.d/ntpd /etc/rc.d/ntpdate /etc/rc.d/othermta /etc/rc.d/pf /etc/rc.d/pflog /etc/rc.d/pfsync /etc/rc.d/postrandom /etc/rc.d/power_profile /etc/rc.d/powerd /etc/rc.d/ppp /etc/rc.d/pppoed /etc/rc.d/pwcheck /etc/rc.d/quota /etc/rc.d/random /etc/rc.d/rarpd /etc/rc.d/rctl /etc/rc.d/resolv /etc/rc.d/rfcomm_pppd_server /etc/rc.d/root /etc/rc.d/route6d /etc/rc.d/routed /etc/rc.d/routing /etc/rc.d/rpcbind /etc/rc.d/rtadvd /etc/rc.d/rtsold /etc/rc.d/rwho /etc/rc.d/savecore /etc/rc.d/sdpd /etc/rc.d/securelevel /etc/rc.d/sendmail /etc/rc.d/serial /etc/rc.d/sppp /etc/rc.d/sshd /etc/rc.d/statd /etc/rc.d/static_arp /etc/rc.d/static_ndp /etc/rc.d/stf /etc/rc.d/swap /etc/rc.d/swaplate /etc/rc.d/syscons /etc/rc.d/sysctl /etc/rc.d/syslogd /etc/rc.d/timed /etc/rc.d/tmp /etc/rc.d/ubthidhci /etc/rc.d/ugidfw /etc/rc.d/utx /etc/rc.d/var /etc/rc.d/virecover /etc/rc.d/watchdogd /etc/rc.d/wpa_supplicant /etc/rc.d/ypbind /etc/rc.d/yppasswdd /etc/rc.d/ypserv /etc/rc.d/ypset /etc/rc.d/ypupdated /etc/rc.d/ypxfrd /etc/rc.d/zfs /etc/rc.d/zvol /etc/rc.firewall /etc/rc.initdiskless /etc/rc.resume /etc/rc.sendmail /etc/rc.shutdown /etc/rc.subr /etc/rc.suspend /etc/regdomain.xml /etc/remote /etc/rpc /etc/security/audit_class /etc/security/audit_control /etc/security/audit_event /etc/security/audit_user /etc/security/audit_warn /etc/services /etc/shells /etc/snmpd.config /etc/ssh/moduli /etc/ssh/ssh_config /etc/ssh/sshd_config /etc/ssl/openssl.cnf /etc/sysctl.conf /etc/syslog.conf /etc/termcap.small /root/.k5login /root/.login *** You installed a new aliases file, so make sure that you run '/usr/bin/newaliases' to rebuild your aliases database Would you like to run it now? y or n [n] y Running /usr/bin/newaliases /etc/mail/aliases: 29 aliases, longest 10 bytes, 297 bytes total *** You installed a login.conf file, so make sure that you run '/usr/bin/cap_mkdb /etc/login.conf' to rebuild your login.conf database Would you like to run it now? y or n [n] y Running /usr/bin/cap_mkdb /etc/login.conf *** You installed a services file, so make sure that you run '/usr/sbin/services_mkdb -q -o /var/db/services.db /etc/services' to rebuild your services database Would you like to run it now? y or n [n] y Running /usr/sbin/services_mkdb -q -o /var/db/services.db /etc/services *** Reinstalling Europe/Oslo as /etc/localtime
ok. Only a reboot needed.
2017-10-09:kvm1 - do the resize dance here too. turn off swap
root@kvm1# swapoff -a swapoff: removing /dev/vtbd0p3 as swap device
check out the drive
root@kvm1# gpart show -p vtbd0 => 34 20971453 vtbd0 GPT (10G) 34 1024 vtbd0p1 freebsd-boot (512K) 1058 15384576 vtbd0p2 freebsd-ufs (7.3G) 15385634 1391549 vtbd0p3 freebsd-swap (679M) 16777183 4194304 - free - (2.0G)
remove swap partition
root@kvm1# gpart delete -i 3 vtbd0 vtbd0p3 deleted
resize p2 partition to about 9.5G
root@kvm1# gpart resize -i 2 -s 9500M vtbd0 vtbd0p2 resized
re-create swap partition
root@kvm1# gpart add -t freebsd-swap vtbd0 vtbd0p3 added
turn on swap
root@kvm1# swapon -a swapon: adding /dev/vtbd0p3 as swap device
verify
root@kvm1# gpart show -p vtbd0 => 34 20971453 vtbd0 GPT (10G) 34 1024 vtbd0p1 freebsd-boot (512K) 1058 19456000 vtbd0p2 freebsd-ufs (9.3G) 19457058 1514429 vtbd0p3 freebsd-swap (739M)
finally, grow the filesystem
before
root@kvm1# df -h Filesystem Size Used Avail Capacity Mounted on /dev/vtbd0p2 7.1G 7.0G -513M 108% / devfs 1.0K 1.0K 0B 100% /dev
grow it
root@kvm1# growfs / Device is mounted read-write; resizing will result in temporary write suspension for /. It's strongly recommended to make a backup before growing the file system. OK to grow filesystem on /dev/vtbd0p2, mounted on /, from 7.3GB to 9.3GB? [Yes/No] yes super-block backups (for fsck_ffs -b #) at: 15387072, 16669312, 17951552, 19233792
after
root@kvm1# df -h Filesystem Size Used Avail Capacity Mounted on /dev/vtbd0p2 9.0G 7.0G 1.2G 85% / devfs 1.0K 1.0K 0B 100% /dev
ok.
2017-10-09: vm4 - resize to 10G, I hope that is enough
tingo@kg-vm4:~$ virsh --connect qemu:///system domblkinfo kvm1 vda Capacity: 8589934592 Allocation: 7870488576 Physical: 8046051328 tingo@kg-vm4:~$ virsh --connect qemu:///system blockresize kvm1 vda 10GBlock device 'vda' is resized tingo@kg-vm4:~$ virsh --connect qemu:///system domblkinfo kvm1 vda Capacity: 10737418240 Allocation: 7870492672 Physical: 8046051488
ok.
2017-10-09: kvm1 - continue make world mergemaster PRE
root@kvm1# mergemaster -p [...]
installworld
root@kvm1# make installworld [..] /: write failed, filesystem is full strip: /usr/lib/st8bwumA: No space left on device strip: /usr/lib/st8bwumA: No space left on device install: wait: No error: 0 *** Error code 70 Stop. make[5]: stopped in /usr/src/lib/libc++ *** Error code 1 Stop. make[4]: stopped in /usr/src/lib *** Error code 1 Stop. make[3]: stopped in /usr/src *** Error code 1 Stop. make[2]: stopped in /usr/src *** Error code 1 Stop. make[1]: stopped in /usr/src *** Error code 1 Stop. make: stopped in /usr/src
and the filesystem is full again.
root@kvm1# df -h Filesystem Size Used Avail Capacity Mounted on /dev/vtbd0p2 7.1G 7.0G -513M 108% / devfs 1.0K 1.0K 0B 100% /dev
yes. Ok, fix it.
2017-10-09: kvm1 - try make kernel again
root@kvm1# pwd /usr/src root@kvm1# make kernel [...] install -o root -g wheel -m 555 iscsi_initiator.ko /boot/kernel install -o root -g wheel -m 555 iscsi_initiator.ko.symbols /boot/kernel kldxref /boot/kernel
much better.
2017-10-09: kvm1 - continue make world
make and install kernel
root@kvm1# make kernel [...] cc -shared -nostdlib hack.c -o hack.So rm -f hack.c MAKE=make sh /usr/src/sys/conf/newvers.sh GENERIC cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -gdwarf-2 -Werror vers.c ctfconvert -L VERSION -g vers.o linking kernel.debug *** Signal 9 Stop. make[2]: stopped in /usr/obj/usr/src/sys/GENERIC *** Error code 1 Stop. make[1]: stopped in /usr/src *** Error code 1 Stop. make: stopped in /usr/src
hmm, failed. From /var/log/messages
Oct 9 01:35:11 kvm1 kernel: pid 74032 (ld), uid 0, was killed: out of swap space Oct 9 01:51:02 kvm1 kernel: pid 16409 (ctfmerge), uid 0, was killed: out of swap space
yes, that might explain it. I forgot to add back the swap partition, fix it:
root@kvm1# swapon -a swapon: adding /dev/vtbd0p3 as swap device root@kvm1# swapinfo -h Device 1K-blocks Used Avail Capacity /dev/vtbd0p3 695772 0B 679M 0%
now, is this enough?
2017-10-08: kvm1 - from inside the machine gpart
root@kvm1# gpart show -p => 34 16777149 vtbd0 GPT (8.0G) 34 1024 vtbd0p1 freebsd-boot (512K) 1058 11951104 vtbd0p2 freebsd-ufs (5.7G) 11952162 628736 vtbd0p3 freebsd-swap (307M) 12580898 4196285 - free - (2.0G)
hmm, do I need to "move" the swap partition first?
try a resize without first
root@kvm1# gpart resize -i 2 vtbd0 vtbd0p2 resized
did it work?
root@kvm1# gpart show -p vtbd0 => 34 16777149 vtbd0 GPT (8.0G) 34 1024 vtbd0p1 freebsd-boot (512K) 1058 11951104 vtbd0p2 freebsd-ufs (5.7G) 11952162 628736 vtbd0p3 freebsd-swap (307M) 12580898 4196285 - free - (2.0G)
nope, it didn't. Ok.
remove swap
root@kvm1# swapoff -a swapoff: removing /dev/vtbd0p3 as swap device
delete swap partition
root@kvm1# gpart delete -i 3 vtbd0 vtbd0p3 deleted
check how it looks
root@kvm1# gpart show -p vtbd0 => 34 16777149 vtbd0 GPT (8.0G) 34 1024 vtbd0p1 freebsd-boot (512K) 1058 11951104 vtbd0p2 freebsd-ufs (5.7G) 11952162 4825021 - free - (2.3G)
try resize
root@kvm1# gpart resize -i 2 -s 7.5G vtbd0 gpart: Invalid size param: Invalid argument
ok, try the other way
root@kvm1# gpart resize -i 2 -s 7512M vtbd0 vtbd0p2 resized
better, verify
root@kvm1# gpart show -p vtbd0 => 34 16777149 vtbd0 GPT (8.0G) 34 1024 vtbd0p1 freebsd-boot (512K) 1058 15384576 vtbd0p2 freebsd-ufs (7.3G) 15385634 1391549 - free - (679M)
add back swap partition
root@kvm1# gpart add -t freebsd-swap vtbd0 vtbd0p3 added
verify
root@kvm1# gpart show -p vtbd0 => 34 16777149 vtbd0 GPT (8.0G) 34 1024 vtbd0p1 freebsd-boot (512K) 1058 15384576 vtbd0p2 freebsd-ufs (7.3G) 15385634 1391549 vtbd0p3 freebsd-swap (679M)
next, grow filesystem
root@kvm1# growfs / Device is mounted read-write; resizing will result in temporary write suspension for /. It's strongly recommended to make a backup before growing the file system. OK to grow filesystem on /dev/vtbd0p2, mounted on /, from 5.7GB to 7.3GB? [Yes/No] yes super-block backups (for fsck_ffs -b #) at: 12822592, 14104832
verify
root@kvm1# df -h Filesystem Size Used Avail Capacity Mounted on /dev/vtbd0p2 7.1G 5.4G 1.1G 83% / devfs 1.0K 1.0K 0B 100% /dev
ok.
2017-10-08: vm4 - virsh confirms that the "disk" is full
tingo@kg-vm4:~$ virsh --connect qemu:///system domblkinfo kvm1 vda Capacity: 6442450944 Allocation: 6219714560 Physical: 6443696128
now, can I resize it?
tingo@kg-vm4:~$ virsh --connect qemu:///system blockresize kvm1 vda 8G Block device 'vda' is resized
verify
tingo@kg-vm4:~$ virsh --connect qemu:///system domblkinfo kvm1 vda Capacity: 8589934592 Allocation: 6219718656 Physical: 6443696256
ok.
2017-10-08: kvm1 - vtbd0p2 - build world
root@kvm1# cd /usr/src root@kvm1# make buildworld [...] -------------------------------------------------------------- >>> World build completed on Mon Oct 9 00:18:52 CEST 2017 --------------------------------------------------------------
build and install kernel
# make kernel [...] /: write failed, filesystem is full ERROR: ctfmerge: if_ath.ko.debug.ctf: Cannot finalize temp file: I/O error: No space left on device :> export_syms awk -f /usr/src/sys/conf/kmod_syms.awk if_ath.ko.debug export_syms | xargs -J% objcopy % if_ath.ko.debug objcopy: stOxheVL: No space left on device objcopy: stOxheVL: No space left on device *** Error code 1 # make kernel [...] /: write failed, filesystem is full ERROR: ctfmerge: if_ath.ko.debug.ctf: Cannot finalize temp file: I/O error: No space left on device :> export_syms awk -f /usr/src/sys/conf/kmod_syms.awk if_ath.ko.debug export_syms | xargs -J% objcopy % if_ath.ko.debug objcopy: stOxheVL: No space left on device objcopy: stOxheVL: No space left on device *** Error code 1 Stop. make[4]: stopped in /usr/src/sys/modules/ath *** Error code 1 Stop. make[3]: stopped in /usr/src/sys/modules *** Error code 1 Stop. make[2]: stopped in /usr/obj/usr/src/sys/GENERIC *** Error code 1 Stop. make[1]: stopped in /usr/src *** Error code 1 Stop. make: stopped in /usr/src Stop. make[4]: stopped in /usr/src/sys/modules/ath *** Error code 1 Stop. make[3]: stopped in /usr/src/sys/modules *** Error code 1 Stop. make[2]: stopped in /usr/obj/usr/src/sys/GENERIC *** Error code 1 Stop. make[1]: stopped in /usr/src *** Error code 1 Stop. make: stopped in /usr/src
ok, need a bigger filesystem.
2017-10-08: kvm1 - vtbd0p2 - get source for FreeBSD 10-stable
root@kvm1# l /usr/src ./ ../
fetch it
root@kvm1# svnlite co https://svn.FreeBSD.org/base/stable/10 /usr/src [...] A 10/games/Makefile.inc A 10/LOCKS U 10 Checked out revision 324416.
check what we got
root@kvm1# egrep "^BRANCH|^REVISION" /usr/src/sys/conf/newvers.sh REVISION="10.4" BRANCH="STABLE"
looks good.
2017-10-08: kvm1 - vtbd0p2 - configure for metamode:
root@kvm1# more /etc/src_env.conf WITH_META_MODE=YES
ok.
2017-10-08: kvm1 - vtbd0p2 - booted the machine again, verified that ntpd is running, and that both filemon and virtio_console is running:
root@kvm1# kldstat Id Refs Address Size Name 1 6 0xffffffff80200000 17bc680 kernel 2 1 0xffffffff819bd000 71f8 virtio_console.ko 3 1 0xffffffff81c11000 5edb filemon.ko
good.
2017-10-08: vm4 - start kvm1 again
tingo@kg-vm4:~$ virsh --connect qemu:///system start kvm1 Domain kvm1 started
verify
tingo@kg-vm4:~$ virsh --connect qemu:///system domstate kvm1 running
get ip address
tingo@kg-vm4:~$ virsh --connect qemu:///system net-dhcp-leases default Expiry Time MAC address Protocol IP address Hostname Client ID or DUID ------------------------------------------------------------------------------------------------------------------- 2017-10-08 21:38:14 52:54:00:73:7c:b6 ipv4 192.168.122.166/24 kvm1 01:52:54:00:73:7c:b6
ok.
2017-10-08: vm4 - virsh says: info
tingo@kg-vm4:~$ virsh --connect qemu:///system dominfo kvm1 Id: - Name: kvm1 UUID: 4ae0041e-9969-4274-9ab9-3dee43ffa02e OS Type: hvm State: shut off CPU(s): 1 Max memory: 524288 KiB Used memory: 524288 KiB Persistent: yes Autostart: disable Managed save: no Security model: none Security DOI: 0
list
tingo@kg-vm4:~$ virsh --connect qemu:///system list Id Name State ---------------------------------------------------- tingo@kg-vm4:~$ virsh --connect qemu:///system list --inactive Id Name State ---------------------------------------------------- - kvm1 shut off
ok.
2017-10-08: kvm1 - vtbd0p2 - I shutdown the machine
2017-10-08: kvm1 - vtbd0p2 - enable filemon (used for META mode)
2017-10-08: kvm1 - vtbd0p2 - retry fetch a new leap-seconds file
root@kvm1# service ntpd fetch root@kvm1# ls -l /var/db/ntpd.leap-seconds.list -rw-r--r-- 1 root wheel 10408 Mar 20 2017 /var/db/ntpd.leap-seconds.list
and (finally) start ntpd
root@kvm1# service ntpd status ntpd is not running. root@kvm1# service ntpd start Starting ntpd. root@kvm1# service ntpd status ntpd is not running.
no?
root@kvm1# ntpdate 10.1.10.1 8 Oct 20:27:51 ntpdate[3996]: step time server 10.1.10.1 offset 7199.814935 sec root@kvm1# ntpdate 10.1.10.1 8 Oct 20:27:59 ntpdate[3997]: adjust time server 10.1.10.1 offset 0.000043 sec root@kvm1# ntpdate 10.1.10.1 8 Oct 20:28:07 ntpdate[3998]: adjust time server 10.1.10.1 offset 0.000088 sec root@kvm1# service ntpd start
Starting ntpd.
root@kvm1# service ntpd status ntpd is running as pid 4006.
that's better.
2017-10-08: kvm1 - vtbd0p2 - fetch a new leap-seconds file
root@kvm1# service ntpd fetch Certificate verification failed for /C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./CN=Starfield Root Certificate Authority - G2 34380983000:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed:/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/s3_clnt.c:1185: fetch: https://www.ietf.org/timezones/data/leap-seconds.list: Authentication error
ok, missing certificate. install pkg
root@kvm1# pkg bootstrap The package management tool is not yet installed on your system. Do you want to fetch and install it now? [y/N]: y Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:10:amd64/quarterly, please wait... Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done Installing pkg-1.10.1... Extracting pkg-1.10.1: 100%
pkg - install certificates
root@kvm1# pkg install ca_root_nss Updating FreeBSD repository catalogue... pkg: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sqlite) failed: No such file or directory Fetching meta.txz: 100% 944 B 0.9kB/s 00:01 Fetching packagesite.txz: 100% 6 MiB 6.1MB/s 00:01 Processing entries: 100% FreeBSD repository update completed. 26957 packages processed. All repositories are up to date. Updating database digests format: 100% The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: ca_root_nss: 3.32.1 Number of packages to be installed: 1 309 KiB to be downloaded. Proceed with this action? [y/N]: y [1/1] Fetching ca_root_nss-3.32.1.txz: 100% 309 KiB 316.7kB/s 00:01 Checking integrity... done (0 conflicting) [1/1] Installing ca_root_nss-3.32.1... Extracting ca_root_nss-3.32.1: 100% Message from ca_root_nss-3.32.1: ********************************* WARNING ********************************* FreeBSD does not, and can not warrant that the certification authorities whose certificates are included in this package have in any way been audited for trustworthiness or RFC 3647 compliance. Assessment and verification of trust is the complete responsibility of the system administrator. *********************************** NOTE ********************************** This package installs symlinks to support root certificates discovery by default for software that uses OpenSSL. This enables SSL Certificate Verification by client software without manual intervention. If you prefer to do this manually, replace the following symlinks with either an empty file or your site-local certificate bundle. * /etc/ssl/cert.pem * /usr/local/etc/ssl/cert.pem * /usr/local/openssl/cert.pem ***************************************************************************
and /var/log/messages also confirms
Oct 8 18:21:54 kvm1 pkg-static: pkg-1.10.1 installed Oct 8 18:22:54 kvm1 pkg: ca_root_nss-3.32.1 installed
ok.
2017-10-07: sdb3 - enable virtio console in the guest:
root@kvm1:~ # more /boot/loader.conf virtio_console_load="YES" root@kvm1:~ # grep ttyV /etc/ttys ttyV0.0 "/usr/libexec/getty Pc" vt100 on secure
after that, virsh console works:
tingo@kg-vm4:~$ virsh --connect qemu:///system console kvm1 Connected to domain kvm1 Escape character is ^] FreeBSD/amd64 (kvm1) (ttyV0.0) login: tingo Password: Last login: Sat Oct 7 22:05:51 on ttyV0.0 FreeBSD 10.3-RELEASE (GENERIC) #0 r297264: Fri Mar 25 02:10:02 UTC 2016 Welcome to FreeBSD! Release Notes, Errata: https://www.FreeBSD.org/releases/ Security Advisories: https://www.FreeBSD.org/security/ FreeBSD Handbook: https://www.FreeBSD.org/handbook/ FreeBSD FAQ: https://www.FreeBSD.org/faq/ Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/ FreeBSD Forums: https://forums.FreeBSD.org/ Documents installed with the system are in the /usr/local/share/doc/freebsd/ directory, or can be installed later with: pkg install en-freebsd-doc For other languages, replace "en" with a language code like de or fr. Show the version of FreeBSD installed: freebsd-version ; uname -a Please include that output and any error messages when posting questions. Introduction to manual pages: man man FreeBSD directory layout: man hier Edit /etc/motd to change this login announcement. $
nice.
2017-10-07: vm4 - sdb3 -after the install, I can check that the machine is running
tingo@kg-vm4:~$ virsh --connect qemu:///system list Id Name State ---------------------------------------------------- 19 kvm1 running
and the ip address
tingo@kg-vm4:~$ virsh --connect qemu:///system net-dhcp-leases default Expiry Time MAC address Protocol IP address Hostname Client ID or DUID ------------------------------------------------------------------------------------------------------------------- 2017-10-08 00:09:48 52:54:00:73:7c:b6 ipv4 192.168.122.166/24 kvm1 01:52:54:00:73:7c:b6
ssh to it
tingo@kg-vm4:~$ ssh tingo@192.168.122.166 Password for tingo@kvm1: Last login: Sat Oct 7 21:18:21 2017 from 192.168.122.1 FreeBSD 10.3-RELEASE (GENERIC) #0 r297264: Fri Mar 25 02:10:02 UTC 2016 Welcome to FreeBSD! Release Notes, Errata: https://www.FreeBSD.org/releases/ Security Advisories: https://www.FreeBSD.org/security/ FreeBSD Handbook: https://www.FreeBSD.org/handbook/ FreeBSD FAQ: https://www.FreeBSD.org/faq/ Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/ FreeBSD Forums: https://forums.FreeBSD.org/ Documents installed with the system are in the /usr/local/share/doc/freebsd/ directory, or can be installed later with: pkg install en-freebsd-doc For other languages, replace "en" with a language code like de or fr. Show the version of FreeBSD installed: freebsd-version ; uname -a Please include that output and any error messages when posting questions. Introduction to manual pages: man man FreeBSD directory layout: man hier Edit /etc/motd to change this login announcement. $
ok. 2017-10-07: vm4 - sdb3 - virt-install - set up the virtual machine and install FreeBSD run virt-install
tingo@kg-vm4:~$ virt-install --connect qemu:///system --name kvm1 --memory 512 --cpu host --vcpus 1 --cdrom ~/dl/bsd/fbsd/10.3/FreeBSD-10.3-RELEASE-amd64-memstick.img --os-variant=freebsd10.3 --disk size=6 --virt-type=kvm --network=default --console pty,target_type=virtio WARNING Graphics requested but DISPLAY is not set. Not running virt-viewer. WARNING No console to launch for the guest, defaulting to --wait -1 Starting install... Allocating 'kvm1-1.qcow2' | 6.0 GB 00:00:00 Creating domain... | 0 B 00:00:00 Domain installation still in progress. Waiting for installation to complete.
ok, next, run virt-viewer:
1) run ssh -Y vm4
from my machine, this sets up X11 trusted forwarding.
2) in the ssh shell, run virt-viewer: virt-viewer --connect qemu:///system kvm1
the display will then be on my local machine.