|
|
As of 2020-04 muvirt has introduced various features to make it easier to get started on a new install:
|
|
|
|
|
|
* LuCI integration with console viewer
|
|
|
* Storage provisioning API
|
|
|
* Appliance Store
|
|
|
|
|
|
All of these are 'proof-of-concept' quality with many bugs and quirks - there are many more improvements planned.
|
|
|
|
|
|
This quickstart will demonstrate these features by deploying a Debian VM from the appliance store.
|
|
|
|
|
|
## Before you start
|
|
|
You will need a mass storage device (NVMe, external USB3 SSD, SATA etc.) to store virtual machines on.
|
|
|
|
|
|
This quickstart assumes you have a client with a browser attached to the 'LAN' network.
|
|
|
|
|
|
Install muvirt to the target and configure the network as required.
|
|
|
|
|
|
## Setting up a disk and default settings
|
|
|
To do a 'turnkey' install you can either do 'samedisk' (add extra partitions to the same drive muVirt is on) or 'fulldisk' (dedicate a full drive to VM storage, muvirt needs to be booted from another storage device).
|
|
|
|
|
|
I suggest using 'fulldisk' mode at the moment as there is no sysupgrade support (on LS1088 platforms) yet - so it is a good idea to keep the muvirt system and VM storage on different devices.
|
|
|
|
|
|
\* Currently, samedisk install is only verified to work against the partition layout in the muvirt ext4 image.
|
|
|
|
|
|
|
|
|
`muvirt-system-setup` will:
|
|
|
1. Partition the storage device as required
|
|
|
2. Setup an LVM2 instance along with a 'scratch' (temporary file) partition and swapfile
|
|
|
|
|
|
On the target, do:
|
|
|
```
|
|
|
# Full disk install
|
|
|
MODE=fulldisk /usr/libexec/muvirt/muvirt-system-setup /dev/nvme0n1
|
|
|
|
|
|
# Samedisk install
|
|
|
/usr/libexec/muvirt/muvirt-system-setup /dev/nvme0n1
|
|
|
```
|
|
|
|
|
|
## Workaround unresponsive nginx
|
|
|
At the time of writing, nginx may fail to respond to requests on boot - I suspect this is a race condition.
|
|
|
|
|
|
You can work around this by adding a restart command to `/etc/rc.local`:
|
|
|
```
|
|
|
root@muvirt:~# cat /etc/rc.local
|
|
|
# Put your custom commands here that should be executed once
|
|
|
# the system init finished. By default this file does nothing.
|
|
|
|
|
|
/etc/init.d/nginx restart
|
|
|
exit 0
|
|
|
```
|
|
|
|
|
|
## Login to LuCI
|
|
|
Go to the LuCI login page at 'https://<router-ip>/' (The default router IP is 192.168.1.1).
|
|
|
![login-screen](uploads/d8d56694860129b228bf364a407d477e/login-screen.jpg)
|
|
|
If you have not yet set a root password, go to 'System->Administration' and set one.
|
|
|
![set-password](uploads/7ebf7bdcb80bcd3efccb2ec6a58065ba/set-password.jpg)
|
|
|
|
|
|
## Update appliance store lists
|
|
|
Go to 'Virtualization->Appliance Store'.
|
|
|
|
|
|
You will need to download the latest lists - click the 'refresh' button.
|
|
|
![appstore-refresh](uploads/5a7b41585dac896d98e957b0de9dd95b/appstore-refresh.jpg)
|
|
|
|
|
|
Due to an unfinished implementation in the current implementation, you will need to do a browser refresh (F5) once the list download is complete (e.g when the refresh button spinner disappears).
|
|
|
|
|
|
Once downloaded, you will have a selection of distribution images to choose from:
|
|
|
![appstore-list](uploads/951c1095bd21232cf634086c9a430595/appstore-list.jpg)
|
|
|
|
|
|
## Configure a new virtual machine
|
|
|
Select an appliance to deploy - for this example we will use Debian stable (buster).
|
|
|
|
|
|
The deploy screen will ask you to name the virtual machine:
|
|
|
![bustername](uploads/5b3859c9cb81fbe0e1cde0dc729b3540/bustername.JPG)
|
|
|
|
|
|
Once named, you will be redirected to the VM settings screen.
|
|
|
|
|
|
Navigate to the 'cloud-init' tab where we can set the user login password:
|
|
|
![buster-cloud-init](uploads/4983bcbfa26846c0e614265dd1821e79/buster-cloud-init.JPG)
|
|
|
|
|
|
Click 'Save' to save the cloud-init settings.
|
|
|
|
|
|
**Attention** The next steps are a bit kludgey as the interactions between the web UI, muvirt and appliancestore modules need to be improved. Be careful to follow these steps in order, otherwise the VM will be deployed without cloud-init settings (and you will not be able to log in).
|
|
|
|
|
|
At the top right of the LuCI UI, there will be an 'unsaved changes' counter, click on it.
|
|
|
![unsaved-changes-1](uploads/f5b2f694242ad02c663a9b968746066c/unsaved-changes-1.JPG)
|
|
|
|
|
|
Confirm the changes by clicking 'Save and apply':
|
|
|
![unsaved-changes-2](uploads/d3e78d68aadb5c99d1f723ea34ed0549/unsaved-changes-2.JPG)
|
|
|
|
|
|
## Provision/Download the VM
|
|
|
Once the changes have been committed to UCI, you can click the 'start' button to start the provisioning process.
|
|
|
|
|
|
At the moment the muvirt LuCI module does not reflect the provisioning status of the VM so the VM will appear as if it hasn't started - this will be improved in the near future.
|
|
|
|
|
|
You can follow the provisioning process in the system log (e.g in the LuCI Status->System Log or by `logread -l 200 -f`):
|
|
|
```
|
|
|
|
|
|
Wed Apr 29 05:09:54 2020 user.notice muvirt: rpc start request for buster
|
|
|
Wed Apr 29 05:09:58 2020 daemon.err muvirt-provision[6779]: % Total % Received % Xferd Average Speed Time Time Time Current
|
|
|
Wed Apr 29 05:09:58 2020 daemon.err muvirt-provision[6779]: Dload Upload Total Spent Left Speed
|
|
|
27 272M 27 74.2M 0 0 4720k 0 0:00:59 0:00:14 0:00:45 9216k
|
|
|
Wed Apr 29 05:10:53 2020 daemon.info muvirt-provision[6779]: /mnt/scratch//buster/image.bin: OK
|
|
|
Wed Apr 29 05:10:53 2020 daemon.info muvirt-provision[6779]: New volume created, path=/dev/mapper/vmdata-buster
|
|
|
Wed Apr 29 05:10:53 2020 daemon.info muvirt-provision[6779]: Writing image to /dev/mapper/vmdata-buster
|
|
|
Wed Apr 29 05:11:49 2020 daemon.err muvirt-provision[6779]: 4+0 records in
|
|
|
Wed Apr 29 05:11:49 2020 daemon.err muvirt-provision[6779]: 4+0 records out
|
|
|
Wed Apr 29 05:11:49 2020 daemon.info muvirt-provision[6779]: mkfs.fat 4.1 (2017-01-24)
|
|
|
Wed Apr 29 05:11:49 2020 daemon.err muvirt-provision[6779]: mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
|
|
|
Wed Apr 29 05:11:49 2020 daemon.info muvirt-provision[6779]: drwxr-xr-x 2 root root 16384 Apr 29 05:11 .
|
|
|
Wed Apr 29 05:11:49 2020 daemon.info muvirt-provision[6779]: drwxrwxrwt 21 root root 580 Apr 29 05:11 ..
|
|
|
Wed Apr 29 05:11:49 2020 daemon.info muvirt-provision[6779]: -rwxr-xr-x 1 root root 0 Apr 29 05:11 meta-data
|
|
|
Wed Apr 29 05:11:49 2020 daemon.info muvirt-provision[6779]: -rwxr-xr-x 1 root root 60 Apr 29 05:11 user-data
|
|
|
Wed Apr 29 05:11:49 2020 daemon.info muvirt-provision[6779]: Provisioning complete, setting provisioned and enabled flags
|
|
|
Wed Apr 29 05:11:49 2020 daemon.info muvirt-provision[6779]: Starting VM buster
|
|
|
Wed Apr 29 05:11:49 2020 daemon.info virt: starting vm instance buster section buster type aarch64 machine virt,gic-version=2
|
|
|
Wed Apr 29 05:11:49 2020 daemon.info virt: using QEMU qemu-system-aarch64
|
|
|
Wed Apr 29 05:11:49 2020 daemon.info muvirt-provision[6779]: Disk 0: /dev/mapper/vmdata-buster
|
|
|
Wed Apr 29 05:11:49 2020 daemon.info muvirt-provision[6779]: Network 0: lan
|
|
|
Wed Apr 29 05:11:49 2020 daemon.info muvirt-provision[6779]: MAC: 52:54:00:47:cb:97
|
|
|
Wed Apr 29 05:11:50 2020 kern.info kernel: [ 1248.416504] br-lan: port 4(tap0) entered blocking state
|
|
|
Wed Apr 29 05:11:50 2020 kern.info kernel: [ 1248.421810] br-lan: port 4(tap0) entered disabled state
|
|
|
Wed Apr 29 05:11:50 2020 kern.info kernel: [ 1248.427540] device tap0 entered promiscuous mode
|
|
|
Wed Apr 29 05:11:50 2020 kern.info kernel: [ 1248.433613] br-lan: port 4(tap0) entered blocking state
|
|
|
Wed Apr 29 05:11:50 2020 kern.info kernel: [ 1248.438895] br-lan: port 4(tap0) entered forwarding state
|
|
|
Wed Apr 29 05:11:50 2020 daemon.err qemu-system-aarch64[6999]: WARNING: Image format was not specified for '/dev/mapper/vmdata-buster' and probing guessed raw.
|
|
|
Wed Apr 29 05:11:50 2020 daemon.err qemu-system-aarch64[6999]: Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
|
|
|
Wed Apr 29 05:11:50 2020 daemon.err qemu-system-aarch64[6999]: Specify the 'raw' format explicitly to remove the restrictions.
|
|
|
Wed Apr 29 05:12:35 2020 daemon.info dnsmasq-dhcp[6050]: DHCPDISCOVER(br-lan) 52:54:00:47:cb:97
|
|
|
Wed Apr 29 05:12:35 2020 daemon.info dnsmasq-dhcp[6050]: DHCPOFFER(br-lan) 192.168.1.237 52:54:00:47:cb:97
|
|
|
Wed Apr 29 05:12:35 2020 daemon.info dnsmasq-dhcp[6050]: DHCPREQUEST(br-lan) 192.168.1.237 52:54:00:47:cb:97
|
|
|
Wed Apr 29 05:12:35 2020 daemon.info dnsmasq-dhcp[6050]: DHCPACK(br-lan) 192.168.1.237 52:54:00:47:cb:97 debian
|
|
|
```
|
|
|
|
|
|
## Login to the VM
|
|
|
Once the provisioning process has finished and the VM started, the console button will be enabled in the Web UI.
|
|
|
![buster-listing](uploads/9d1b8786e3dfd464c504a42f7a86d1f9/buster-listing.jpg)
|
|
|
|
|
|
On the first boot, cloud-init will take a while to setup the system. If your first login attempt fails, wait a moment for cloud-init to finish.
|
|
|
|
|
|
You can then log in as the default user (e.g 'debian') using the password set earlier:
|
|
|
![web-console](uploads/2ad54e68c5ac3864085fe6c6a6d98a93/web-console.jpg) |
|
|
\ No newline at end of file |