User Tools

Site Tools


vm:virtualbox:archbsd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
vm:virtualbox:archbsd [2021/12/29 19:54] – ↷ Page moved and renamed from archbsd:virtualbox to vm:virtualbox:archbsd warnaudvm:virtualbox:archbsd [2022/04/21 13:05] (current) – [Update] warnaud
Line 1: Line 1:
 +====== Update ======
 +The below method doesn't work anymore.\\
 +SSH is inaccessible/unsetable on the iso (2014-09)\\
  
 +====== Introduction ======
 +Purpose: test if it's easily installable, using ZFS avoiding SystemD :-X\\
 +Main web site: [[https://www.archbsd.net/]]\\
 +Wiki: [[https://wiki.archbsd.net/index.php/Main_Page]]
 +
 +====== VM creation ======
 +From VIrtualBOX: New / BSD / FreeBSD 64\\
 +RAM: 1024MB\\
 +Edit the VM for:
 +  * bidirectional clipboard
 +  * Bridged Adapter
 +  * Remove IDE disk
 +  * Add SATA controller
 +  * Add SATA disk ~ 5GB
 +  * Set as SSD hard drive
 +  * Mount ArchBSD iso in CD
 +Save and launch the VM
 +====== Install ======
 +===== SSH access =====
 +==== Network ====
 +Find the ip of your VM:
 +<code bash>
 +ifconfig
 +dhclient em0
 +</code>
 +==== Root Password ====
 +Change root password
 +<code bash>
 +passwd</code>
 +==== SSHD config ====
 +Setup sshd
 +<code bash>vi /etc/ssh/sshd_config</code>
 +Then change/uncomment
 +<code>
 +[…]
 +PermitRootLogin yes
 +[…]
 +PasswordAuthentication yes
 +[…]
 +ChallengeResponseAuthentication no
 +</code>
 +==== Start SSHD ====
 +Then Launch sshd:
 +<code bash>
 +/etc/init.d/sshd start
 +</code>
 +\\
 +Then remote connect to it
 +===== Setup keyboard =====
 +<code bash>kbdmap</code>
 +===== GPT partition =====
 +<code bash>
 +gpart create -s gpt ada0
 +gpart add -s 128k -t freebsd-boot ada0
 +gpart add -s 1g -t freebsd-swap ada0
 +gpart add -t freebsd-zfs ada0
 +</code>
 +===== ZFS Pool =====
 +<code bash>
 +zpool create tank /dev/ada0p3
 +</code>
 +Interesting output:
 +<code>
 +cannot mount '/tank': failed to create mountpoint
 +Exit 1</code>
 +===== Bootloader =====
 +<code bash>gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i1 ada0</code>
 +===== ZFS Pool =====
 +==== Reimport ====
 +<code bash>mdmfs -t swap -s 128m md /boot/zfs</code>
 +Interesting output:
 +<code>mdmfs: mdconfig (attach) exited with error code 1
 +Exit 1</code>
 +<code bash>zpool export tank</code>
 +<code bash>zpool import -o altroot=/mnt -o cachefile=/boot/zfs/zpool.cache -f tank</code>
 +Interesting output:
 +<code>cannot mount '/mnt/tank': failed to create mountpoint
 +Exit 1</code>
 +==== Checksum (optional) ====
 +<code bash>zfs set checksum=fletcher4 tank</code>
 +==== Datasets ====
 +<code bash>
 +zfs create -o canmount=off -o mountpoint=legacy tank/ROOT
 +zfs create -o canmount=on -o compression=on -o mountpoint=/ tank/ROOT/archbsd-0
 +zfs create -o compression=on -o mountpoint=/home tank/HOME
 +zfs create -o compression=off -o mountpoint=/root tank/HOME/root
 +</code>
 +====== Installing Base ======
 +<code base>pacstrap /mnt base</code>
 +
 +Interesting output ...
 +<code>
 +downloading required keys...
 +:: Import PGP key 2048R/, "Claudiu Traistaru <claudiu2004@gmail.com>", created: 2013-09-11? [Y/n] 
 +error: key "Claudiu Traistaru <claudiu2004@gmail.com>" could not be imported
 +error: required key missing from keyring
 +error: failed to commit transaction (unexpected error)
 +Errors occurred, no packages were upgraded.
 +==> ERROR: Failed to install packages to new root
 +Exit 1
 +</code>
 +
 +FIXME Workaround:
 +<code bash>cp /etc/pacman.conf /tmp/. </code>
 +modifiy /etc/pacman.conf like:
 +<code>
 +#SigLevel    = Required DatabaseOptional
 +SigLevel = Never
 +</code>
 +
 +then re-run pacstrap as:
 +<code base>pacstrap -C /tmp/pacman.conf /mnt base</code>
 +
 +Errors / warnings:
 +<code>
 +[…]
 +( 6/27) installing bash                                             [######################################################################] 100%
 +install-info: No such file or directory for /usr/share/info/bash.info.gz
 +[…]
 +(24/27) installing pacman                                             [######################################################################] 100%
 + >>> Run  `pacman-key --init; pacman-key --populate archlinux`
 + >>> to import the data required by pacman for package verification.
 + >>> See: https://www.archlinux.org/news/having-pacman-verify-packages
 +</code>
 +
 +====== System configuration ======
 +===== Chroot =====
 +<code bash>  chroot /mnt </code>
 +===== /etc/fstab =====
 +<code bash>
 +cat << EOF > /etc/fstab
 +# Device    Mountpoint FStype Options Dump Pass #
 +proc        /proc      procfs rw      0    0
 +/dev/ada0p2  none      swap   sw      0    0
 +EOF
 +</code>
 +===== /boot/loader.conf =====
 +<code bash>
 +cat << EOF >> /boot/loader.conf
 +vfs.root.mountfrom="zfs:tank/ROOT/archbsd-0"
 +EOF
 +</code>
 +:!: no need to add this (already in the file :!:
 +<code>
 +     25 # Load File-System Support
 +     26 zfs_load="YES"
 +</code>
 +===== timezone =====
 +<code bash>
 +ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime </code>
 +===== hostname =====
 +<code bash>
 +echo 'HOSTNAME="archBSD"' > /etc/conf.d/hostname
 +</code>
 +===== Root passwd =====
 +<code bash>
 +passwd
 +</code>
 +===== Exit chroot =====
 +Exit from chroot
 +<code bash>exit</code>
 +===== zpool save =====
 +<code bash>
 +cp /boot/zfs/zpool.cache /mnt/boot/zfs/zpool.cache
 +</code>
 +Fails ... of course :@
 +<code>
 +cp: /boot/zfs/zpool.cache: No such file or directory
 +Exit 1
 +</code>
 +===== Bootfs =====
 +<code bash>
 +zpool set bootfs=tank/ROOT/archbsd-0 tank
 +</code>
 +===== FreeBSD init =====
 +<code bash>
 +echo zfs_enable="YES" > /mnt/etc/rc.conf
 +</code>
 +===== Reboot =====
 +Cross fingers …
 +====== Post Install ======
 +The adventure begun
 +===== base-devel =====
 +<code bash>pacman -S base-devel</code>
 +
 +FIXME Work in progress !
 +
 +====== References ======
 +  * [[https://wiki.archbsd.net/index.php/Official_Arch_BSD_Install_Guide | Install guide]]
 +  * [[https://wiki.archbsd.net/index.php/Official_Arch_BSD_ZFS_Install_Guide | Install guide ZFS]]