Clear Linux* OS on VirtualBox*

This page explains how to create a virtual machine on the VirtualBox hypervisor with Clear Linux* OS as the guest operating system. These instructions support the Clear Linux OS live-server installer to create the Clear Linux OS virtual machine (VM).

Prerequisites

  1. Enable virtualization, such as Intel® Virtualization Technology (Intel® VT), on the host system from EFI/BIOS.

  2. Download and install VirtualBox version 6.0 or later from VirtualBox using the VirtualBox Installation Instructions for your platform.

Download and extract the Clear Linux OS installer ISO

  1. Download the clear-<VERSION>-live-server.iso.xz of Clear Linux OS on the Downloads page.

  2. Validate the integrity of the downloaded image by checking the file hash and signatures. Refer to Validate signatures for detailed steps.

  3. Decompress the downloaded image.

    • On Windows, you can use 7zip to extract the file by right-clicking the file to Extract Here (in the same directory)

    7zip extract here command

    Figure 1: 7zip extract here command

    • On Linux :

      xz -d clear-<VERSION>-live-server.iso.xz
      
  4. Delete the originally downloaded compressed file.

Create a new VirtualBox virtual machine

A new VM needs to be created in VirtualBox Manager where Clear Linux OS will be installed. General instructions for creating a virtual machine and details about using different settings are available in the VirtualBox manual section Creating Your First Virtual Machine.

  1. Launch the VirtualBox Manager from your host system.

  2. Click the New button to create a new VM.

  3. Choose Expert mode.

  4. On the Create Virtual Machine screen, enter the following settings:

    • Name: Choose name (e.g. ClearLinuxOS-VM).

    • Type: Linux

    • Version: Linux 2.6 / 3.x / 4.x (64-bit)

    • Hard disk: Create a virtual hard disk now

    • Memory size default: 2048 MB (Adjust appropriately.)

      Note

      Later, if you want to change the amount of RAM allocated, power down your VM. Return to Settings > System and change Base Memory to the desired size.

    Create Virtual Machine

    Figure 2: Create Virtual Machine

  5. Click Create.

  6. On the Create Virtual Hard Disk screen, select:

    • File location

    • File size: 32.00 GB. Adjust size to your needs.

    • Hard disk file type: VDI (VirtualBox Disk Image)

    • Storage on physical hard disk: Dynamically allocated

    Create Virtual Hard Disk

    Figure 3: Create Virtual Hard Disk

  7. Click Create.

    A new virtual machine will be created and appear in the VirtualBox Manager.

  8. Click Settings to configure the Clear Linux OS VM.

  9. In the left-hand menu, navigate to the System menu.

  10. On the Motherboard tab, select the Chipset menu, and then select ICH9. See Figure 4.

    Note

    You can select which chipset will be presented to the virtual machine. Consult the VM VirtualBox User Manual for more details.

  11. In Enabled Features, check these boxes:

    • Enable I/O APIC

    • Enable EFI (special OSes only)

    Settings > System

    Figure 4: Settings > System

    Note

    By default, only 1 virtual CPU is allocated to the new VM. Consider increasing the number of virtual processors allocated to the virtual machine under Settings > System > Processor for increased performance.

  12. Click OK.

Install Clear Linux OS on the VirtualBox VM

Clear Linux OS is ready to be installed.

Mount the installation ISO

The Clear Linux OS installer ISO needs to be mounted as a virtual CD-ROM on the VM before powering the VM on.

  1. From the ClearLinux-OS Settings menu at left, select Storage.

  2. From Storage Devices, middle column, click the blue disk labeled Empty.

  3. From the Attributes menu, click the blue CD disk next to the Optical Drive drop down menu and click Choose Virtual Optical Disk File…

    Choose Virtual Optical Disk Drive

    Figure 5: Choose Virtual Optical Disk Drive

  4. Where there appears Please choose a virtual optical disk file, select the ISO file and click Open.

    Mounting an ISO

    Figure 6: Mounting an ISO

  5. Click OK to exit and return to the main VirtualBox Manager.

Install Clear Linux OS with live-server installer

  1. In the VirtualBox Manager, select virtual machine you created and click Start.

    Start the installer

    Figure 7: Start the installer

    Note

    To release the mouse cursor from the VM console window, press the right Ctrl key on the keyboard.

  2. When Clear Linux Installer in boot manager appears, select Enter. Do not install the bundle desktop-autostart.

  3. Follow the steps in Install Clear Linux* OS from the live server to install Clear Linux OS onto the VM virtual disk. Note:

    1. In Configure Installation Media, navigate top VBOX HARDDISK, and then select Confirm.

    2. In Advanced options ‣ Manage User, create an administrative user.

    3. Do not install the bundle desktop-autostart.

  4. When Clear Linux OS installation is complete, click Exit.

  5. At the prompt, enter:

    shutdown now
    

Unmount the ISO

The Clear Linux OS installer ISO needs to be unmounted to allow the VM to boot from the virtual hard disk.

  1. Return to the VirtualBox Manager.

  2. Click Settings to configure the Clear Linux OS VM.

  3. From the VM Settings window, navigate to the Storage pane in the left menu.

  4. From the middle Storage Devices column, click the blue CD disk labeled clear-<VERSION>-live-server.iso under the Controller: IDE.

  5. From the Attributes column on the right, in Optical Drive, select the blue CD icon beside and click Remove Disk from Virtual Drive.

    Remove Disk from Virtual Drive

    Figure 8: Remove Disk from Virtual Drive

  6. Click OK to exit the VM Settings menu and return to the main VirtualBox Manager.

Install VirtualBox Linux Guest Additions

Clear Linux OS provides Linux Guest Additions drivers for full compatibility using an install script in the kernel-lts (Long Term Support) bundle by Clear Linux OS.

  1. From the VirtualBox Manager select the Clear Linux OS VM, and select Start.

  2. In the VM Console, log in as the administrative user previously created.

    Note

    A message may appear: “A kernel update is available: you may wish to reboot the system.”

    To update the kernel, enter:

    sudo reboot
    

    At initial login, enter the administrative user’s password and continue.

  3. Validate the installed kernel is kernel-lts by checking the output of the uname -r command. It should end in .lts or .lts2018.

    uname -r
    <VERSION>.lts
    

    If the running kernel is not lts: install the LTS kernel manually, update the bootloader, and check again:

    sudo swupd bundle-add kernel-lts
    clr-boot-manager set-kernel $(basename $(realpath /usr/lib/kernel/default-lts))
    clr-boot-manager update
    reboot
    
  4. Remove any kernel bundles that do not end in -lts or kernel-install to simplify and avoid conflicts:

    sudo swupd bundle-list | grep kernel
    sudo swupd bundle-remove <NON-LTS-KERNEL>
    
  5. In the VM Console top menu, click Devices, and select Insert Guest Additions CD image… to mount the VirtualBox driver installation to the Clear Linux OS VM.

    Insert Guest Additions CD image

    Figure 9: Insert Guest Additions CD image

  6. If a dialogue appears, “VBx_GAs_6.0.8… Would you like to run it?”, select Cancel.

    Instead, we provide a script to patch and install VirtualBox drivers on Clear Linux OS.

  7. Open a Terminal and enter the script:

    sudo install-vbox-lga
    

    Note

    Successful installation shows: “Guest Additions installation complete”. If drivers are already installed, don’t re-install them.

  8. Shut down the system. Select Machine ‣ ACPI Shutdown.

    Powering off a VirtualBox VM

    Figure 10: Powering off a VirtualBox VM

  9. Select Settings, Display.

  10. In Graphics Controller, select VBoxSVGA to adjust screen size dynamically.

    Remove Disk from Virtual Drive

    Figure 11: VirtualBox hardware acceleration error

  11. In the VirtualBox Manager, select Start.

  12. In the VM console, login and verify the VirtualBox drivers are loaded:

    lsmod | grep ^vbox
    

    You should see drivers loaded with names beginning with vbox: (e.g., vboxvideo, vboxguest).

  13. Add desktop-autostart for a full desktop experience.

    sudo swupd bundle-add desktop-autostart
    
  14. Reboot the VM and log in with the administrative user.

    sudo reboot
    

The Clear Linux OS VM running on VirtualBox is ready to develop and explore.

Troubleshooting

  1. Problem: On a Microsoft* Windows* OS, VirtualBox encounters an error when trying to start a VM indicating VT-X/AMD-v hardware acceleration is not available on your system.

    Remove Disk from Virtual Drive

    Figure 12: VirtualBox hardware acceleration error

    Solution: First, double check the Prerequisites section to make sure Hardware accelerated virtualization extensions have been enabled in the host system’s EFI/BIOS.

    Hardware accelerated virtualization, may get disabled for VirtualBox when another hypervisor, such as Hyper-V is enabled.

    To disable Hyper-V execute this command in an Administrator: Command Prompt or Powershell, and reboot the system:

    bcdedit /set {current} hypervisorlaunchtype off
    

    To enable Hyper-V again, execute this command in an Administrator: Command Prompt or Powershell, and reboot the system:

    bcdedit /set {current} hypervisorlaunchtype Auto
    

Intel and the Intel logo are trademarks of Intel Corporation or its subsidiaries.