Two for the price of one – running Oracle Linux on Windows Subsystem for Linux (WSL) – Oracle Linux 8 – Get It? Got It? Good!

Two for the price of one – running Oracle Linux on Windows Subsystem for Linux (WSL)

There is one last way to install Oracle Linux on Microsoft Windows desktops, with WSL.

WSL lets you easily install Oracle Linux directly on Windows without the need to install a traditional VM such as VirtualBox. WSL includes an integrated VM, preconfigured for Windows, hiding the hypervisor from the user. WSL also has the advantage of enabling Linux commands straight from Windows, including Linux services such as Apache, MySQL, SSHD, Nginx, and PostgreSQL.

Getting ready

Before you start, you will need a Windows 10 or Windows 11 system with internet access. You will also need local admin privileges on the system. This is not a difficult recipe and is well worth the time.

How to do it…

Installing WSL is fairly straightforward. You will need to take the following steps:

  1. Start Command Prompt as an administrator. Don’t forget to right-click on Command Prompt to run this as an administrator, as shown in the following screenshot:

Figure 1.5 – Running Command Prompt as an administrator

Note

While these instructions are for WSL, please note that it’s really covering WSL2. There was an earlier release of WSL, also known as WSL1, that works slightly differently and is no longer used or deployed. Older versions of WSL should normally be avoided. This also goes for the OS version; use the latest 8.X version when possible.

2. From Command Prompt, run the wsl.exe –install command. This will start several tasks off, including installing the Microsoft VM platform that enables WSL under the covers, installing the WSL subsystem itself, and installing an Ubuntu Linux distro.

Once the installation is complete, as seen in the following screenshot, Windows will need to be rebooted:

Figure 1.6 – WSL installation

3. Once your system is backed up, we will install Oracle Linux 8.5 as the Linux OS used by WSL. To do this, start the Microsoft Store application and search for Oracle Linux in the search bar:

Figure 1.7 – Microsoft Store searching for Oracle Linux 8.5

4. In the search results, select the Oracle Linux 8.5 app. This will take you to the screen where you can download and install Oracle Linux 8.5 under WSL:

Figure 1.8 – Oracle Linux 8.5 in the Microsoft Store

5. Click on the Get button. This will start the download and installation of Oracle Linux 8.5 for the Windows system. The download should only take a few minutes, and once completed, you can run Oracle Linux 8.5. However, in the future, you will need to run the Oracle Linux 8.5 subsystem by searching for it in the program list, by hitting the Windows key and then typing in Oracle Linux. This not only finds the subsystem but also gives you the option to pin the subsystem to your taskbar or Start menu, as shown in the following screenshot:

Figure 1.9 – Oracle Linux 8.5 subsystem app options

6. When you run the WSL subsystem, it works almost identically to any other Oracle Linux 8.5 system. You can easily run Oracle Linux commands under Windows now. This includes checking storage capacity, using dnf to install programs, editing files, and SSHing to other hosts:

Figure 1.10 – WLS OS commands

You can also install new software with dnf. An example of installing nmap is shown in the following figure:

Figure 1.11 – WSL installing nmap with dnf

You can also access your Windows drives from WLS. They will each be presented under the /mtn/DRIVE location, where the C: drive is /mnt/c. The Windows system can also access the Linux directory under the \\wsl$\OracleLinux_8_5 path:

Figure 1.12 – Windows File Explorer and WSL

Caution

As a note of caution, be careful when you’re editing files. Windows and Linux format text differently, and you can easily accidentally corrupt files if you are not careful. It is recommended that Windows files are stored and accessed using Windows, and Linux files are edited and stored on the WSL image.

Running Oracle 8.5 as a Windows subsystem is a great tool for system administrators and developers. Its integration with Windows makes for a quick and easy installation while enabling transparent access to a Linux system on your personal system.

Leave a Reply

Your email address will not be published. Required fields are marked *

All Rights Reserved 2022-2024