Eclipsys Blog

Migrate VirtualBox VM to OCI in Five Steps

Written by Dinusha Rathnamalala | Nov 28, 2024 3:03:06 PM

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.

  1. Install and customize RedHat Linux 7.9 on Oracle VirtualBox 7
  2. Install VM Extension Pack
  3. Create a Cloud Profile on the VirtualBox
  4. Export VM to OCI
  5. Configure network on imported VM

These are the detailed steps:

  1. Install VirtualBox 7 and,
  2. VM Extension Pack.

Use the below link to download software - https://www.oracle.com/ca-en/virtualization/technologies/vm/downloads/virtualbox-downloads.html

  1. Create a Cloud Profile

On the VirtualBox, select File -> Tools -> Cloud Profile Manager

  1. 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.

  1. 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.