Oracle Cloud Infrastructure provides the option to import a custom Linux image. Before an Oracle VM VirtualBox image can be exported to Oracle Cloud Infrastructure, the custom image needs to be prepared to ensure that instances launched from the custom image can boot correctly and that network connections will work. This section provides advice on how to prepare a Linux image for export from Oracle VM VirtualBox.
The following list shows some tasks to consider when preparing an Oracle Linux VM for export:
Use DHCP for network addresses. Configure the VM to use a DHCP server to allocate network addresses, rather than using a static IP address. The Oracle Cloud Infrastructure instance will then be allocated an IP address automatically.
Do not specify a MAC address. The network interface configuration for the VM must not specify the MAC address.
Remove the HWADDR setting from the
Disable persistent network device naming rules. This means that the Oracle Cloud Infrastructure instance will use the same network device names as the VM.
Change the GRUB kernel parameters.
Add
Update the GRUB configuration.
# grub2-mkconfig -o /boot/grub2/grub.cfg
Disable any
For example, if an automated
# cd /etc/udev/rules.d # rm -f 70-persistent-net.rules # ln -s /dev/null /etc/udev/rules.d/70-persistent-net.rules
Enable the serial console. This enables you to troubleshoot the instance when it is running on Oracle Cloud Infrastructure.
Edit the
Remove the
Replace
Add
Add
Regenerate the GRUB configuration.
# grub2-mkconfig -o /boot/grub2/grub.cfg
To verify the changes, reboot the machine and run the
# dmesg |grep console=ttyS0
Enable paravirtualized device
support. You do this by adding the
This procedure works only on machines with a Linux kernel of version 3.4 or later. Check that the VM is running a supported kernel:
# uname -a
Use the
# dracut –-logfile /var/log/Dracut.log --force --add qemu
Verify that the
# lsinitrd |grep virtio
For more information about importing a custom Linux image into Oracle Cloud Infrastructure, see also: