Virtualbox Install

From UVOO Tech Wiki
Jump to navigation Jump to search

Start with base minimal install

Install zfs

apt install zfsutils-linux -

Create tank pool - you can collapse these commands

zpool create -f tank mirror sdd sde mirror sdf sdg mirror sdh sdi mirror sdj sdk
sudo zpool add tank mirror nvme2n1 nvme3n1
sudo zpool add tank log mirror nvme0n1 nvme1n1
sudo zpool add tank cache nvme2n1 nvme3n1

https://docs.oracle.com/cd/E19253-01/819-5461/gaztn/

zfs create tank/home

zfs set mountpoint=/home pool/home

https://www.virtualbox.org/wiki/Linux_Downloads

systemctl stop lxd lxd.socket
rm -Rf /var/lib/lxd
zfs create tank/lxd-daemon -o /var/lib/lxd
systemctl start lxd
lxc storage create default zfs source=tank/lxd
lxc profile device add default root disk pool=default path=/

Use ZFS, XFS for Home Directory

https://docs.oracle.com/cd/E19253-01/819-5461/gaztn/index.html

No vm guest console attach so just use x11 forwarding. Server needs some X11 packages installed.

From Linux box

ssh -X <username>@<hostname>

virtualbox

It looks like VirtualBox does not provide this functionality. Best that it seems I can do is to use a remote desktop. For my CentOS, the most convenient app is rdesktop. You need to have the extension pack installed. Then enable remote desktop protocol for the client. Once the VM is running you can then use rdesktop to access the client console. If rdesktop is started immediately after the VM, you do get access to the boot sequence. Thus:

$ vboxmanage modifyvm "archive" --vrde on $ vboxmanage startvm "archive" --type headless ; rdesktop localhost

Sometimes it is nice to turn on a gui on the host when you need it.

sudo apt-get install --no-install-recommends ubuntu-desktop

If you want example apps apt-get install ubuntu-desktop (gnome 3 default)

Disable it to only run when you want.

Edit /etc/default/grub with your favourite editor, e.g. nano:

sudo nano /etc/default/grub Find this line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" Change it to:

GRUB_CMDLINE_LINUX_DEFAULT="text" Update GRUB:

sudo update-grub For systems that use systemd This is an additional step for systemd releases, e.g. Ubuntu 15.04, the steps above for grub are still necessary.

You need to tell systemd to not load the graphical login manager:

sudo systemctl enable multi-user.target --force sudo systemctl set-default multi-user.target You will still be able to use X by typing startx after you logged in.

Moving Home Directory

From Terminal type this:

sudo mkdir /mnt/tmp sudo mount /dev/sdb1/ /mnt/tmp which will allow you to temporarily mount the new partition, assuming /sdb1 as new partition for HOME.

sudo rsync -avx /home/ /mnt/tmp This will copy HOME to new location.

sudo mount /dev/sdb1 /home This will mount the new partition as HOME and makes sure all data is present.

sudo umount /home
This will unmount the new partion.

rm -rf /home/*
This deletes the old HOME.

To make HOME permanent you need to know the UUID of the new partition for the fstab entry. you can get that by giving command:

sudo blkid Note down the UUID and use the same to change fstab .

sudo nano /etc/fstab
Now add the following at the end.

UUID= /home ext4 defaults 0 2 NOTE: You need to select the exact file system that was formatted(for example ext4 as chosen here).

Now you can Resart your computer to see the new HOME