Recently one of our customers requested to create a custom Red Hat Linux 7.9 operating system on an OCI compute instance. To fulfill this requirement, I followed the simple five-step process outlined below.
- Install and customize RedHat Linux 7.9 on Oracle VirtualBox 7
- Install VM Extension Pack
- Create a Cloud Profile on the VirtualBox
- Export VM to OCI
- Configure network on imported VM
These are the detailed steps:
- Install VirtualBox 7 and,
- VM Extension Pack.
Use the below link to download software - https://www.oracle.com/ca-en/virtualization/technologies/vm/downloads/virtualbox-downloads.html
- Create a Cloud Profile
On the VirtualBox, select File -> Tools -> Cloud Profile Manager
- Export VM to OCI
We can export the VM to OCI. Right-click on the VM and select Export to OCI.
Make sure to select the Launch Mode as PARAVIRTUALIZED. Select the bucket in OCI to store the custom image.
Change the setting as per your requirements.
Specify the VCN and Subnet.
- Configure network on imported VM
Now we have imported VM. However, we cannot log in to the server using public IP due to the different network connection - enp0s3 being configured on VirtualBox. We need to delete this network connection and create it for eth0. Follow the below steps.
# check the connection
nmcli connection show
# check the device
nmcli -f DEVICE,TYPE device
# check the device status
nmcli general status
# delete the existing connection
nmcli connection delete enp0s3
# check the connection
nmcli connection show
# create a new connection with eth0
nmcli connection add type ethernet ifname eth0 con-name eth0
|
This concludes the five steps to migrate a VirtualBox VM to OCI.