Skip to content

Migrate VirtualBox VM to OCI in Five Steps

Dinusha Rathnamalala Nov 28, 2024 10:03:06 AM
Migrate VirtualBox VM to OCI in Five Steps
1:46

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

Screenshot 2024-11-28 at 9.57.52 AM

  1. Export VM to OCI

We can export the VM to OCI. Right-click on the VM and select Export to OCI.

Screenshot 2024-11-28 at 9.58.28 AM

Make sure to select the Launch Mode as PARAVIRTUALIZED. Select the bucket in OCI to store the custom image.

Screenshot 2024-11-28 at 9.58.48 AM

Change the setting as per your requirements.

Screenshot 2024-11-28 at 9.59.10 AM

Specify the VCN and Subnet.

Screenshot 2024-11-28 at 9.59.29 AM

Screenshot 2024-11-28 at 9.59.51 AM

  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.

 

Leave a Comment