This article explains how to install Ubuntu Core over a Virtual Machine (VM) using VirtualBox over a MacBook Pro Intel based, for development/experimentation purpose.
Ubuntu Core is not a standard distribution and cannot be installed directly over Virtualbox.
It is necessary to use a standard/normal Ubuntu distribution to be used as installer.
Prerequisites
This document refers to a MacBook Pro 2019 Intel as host, running macOS Sonoma 14.3 and VirtualBox vs. 7.0.14.
It is assumed VirtualBox to be installed and working without problems.
VirtualBox configuration
The instance for Ubuntu Core need to be configured not as default.
Create a new machine (Machine - New)
Assign 2 GB RAM - 2 CPU and enable EFI
Note !
In case JetBrain IntelliJ (or similar IDE) is used to be attached to the server, allocate AT LEAST 4 GB RAM !Create a 10 GB disk, dynamic
Summary of the VM for Ubuntu Core
At this point is possible to create the VM, clicking on Finish, a new VM named (as per the example) ubuntu-core-22 will be present.
On the Network setting change the Adapter 1 from NAT (default) to Bridge
Ubuntu Core installation
As mentioned at the beginning, Ubuntu Core cannot be installed directly on the VM.
On a real embedded card would be installed via snap or on a SD card.
On the VM is necessary to use a standard Linux distribution as installer.
From the Ubuntu website download the latest Ubuntu Desktop (at the article time 22.04 LTS) and then use that image to start the VM created in the previous paragraph.
Basically start the VM and since the first time nothing is assigned, select the downloaded Ubuntu desktop image
Once the image starts, be sure to DON’T install it, just try it.
When the image starts, open Firefox in the image, NOT on the host, and go to the url : cdimage.ubuntu.com and navigate to find Ubuntu Core 22, specifically :
and download the base image : ubuntu-core-22-amd64.img.xz
In order to install the downloaded image we need to open the terminal.
Remember that the VM is still running the “try Ubuntu” option and thus it could be extremely slow !
At this point is necessary to open a terminal in order to install the Ubuntu Core on the VM.
Once opened the terminal :
switch as root
sudo -i
locate the disk where to install the image, is the 10 Gbyte one
Using the fdisk command, see the partitions on the VM and identify the main one (the 10 Gbyte one), typically is the /dev/sda.fdisk -l
go to the directory where the Ubuntu Core image is downloaded
cd /home/ubuntu/Downloads
extract the image on the VM disk using the dd command
xzcat ubuntu-core-22-amd64.img.xz | dd of=/dev/sda bs=32M status=progress; sync
Reboot the VM
The first time Ubuntu Core is rebooting it can take some quite time and multiple restarts.
The boot is done by EFI.
Ubuntu Core usage
Once the VM is ready, it will ask for configuration
Press Enter.
Select the Configure the network and setup an administrator account on this all-snap Ubuntu Core system
Click OK and follow the menu.
Note, the setup will end up creating an ssh access to the machine using the settings present in the Ubuntu One website.
This means is necessary to have an Ubuntu One account.
On this account will be necessary to save the public key of the host/hosts able to access the image.
Typically the host is the one to run the VM, but actually any host in the network will be able to access the Ubuntu Core running on the VM via ssh, assumed it has the key stored in Ubuntu One.
Via ssh will be possible to access the Ubuntu Core machine.
Resources
- https://www.youtube.com/watch?v=f2oOjl1em1s&t=792s
No comments:
Post a Comment