WSL (Windows Subsystem for Linux) is available as a mechanism to use Linux from Windows 10.
This article introduces the procedure for building Preloader / U-boot for Arria® 10 SoC FPGA Development Board and Cyclone® V SoC FPGA Development Board using WSL.
In this article, we will explain how to set up the environment for using WSL.
Note:
For the procedure of building Preloader / U-boot on WSL, please refer to [Part 2: Build].
1. What is WSL (Windows Subsystem for Linux) ?
- It is a mechanism to use Linux from Windows 10.
- It is available on Windows 10 (Fall Creators Update, version 1709 or later).
-
In the past, a virtual machine environment had to be installed when using Linux on Windows, but by using WSL, Linux can be used easily and with low overhead.
- From the WSL side, all files (those not prohibited by Windows) and folders on the Windows OS side can be accessed.
Note:
There are two different WSL environments: WSL 1, which was initially released, and WSL 2 (Windows Subsystem for Linux 2), which is supported in Windows 10 version 2004 and later. Please note that the information presented here is for WSL 1.
2. Installing WSL
2-1. Enable WSL function of Windows 10
(1)
Select [Start] -> [Settings] in Windows 10 and click [Apps].
[Figure 1] Windows Settings
(2)
From [Apps and Features], click [Programs and Features].
[Figure 2] Apps and Features Settings
(3)
Click [Turn Windows features on or off], check [Windows Subsystem for Linux] and click [OK].
[Figure 3] Enabling Windows Subsystem for Linux
(4)
Restart the PC by clicking [Restart now].
[Figure 4] Click [Restart Now] to restart your PC
2-2. Install Ubuntu 18.04 LTS from Microsoft Store
In this example, Ubuntu 18.04 LTS is installed.
(1)
Select [Start] -> [Microsoft Store] in Windows 10. You will be directed to Microsoft Store, search for "Ubuntu" and select [Ubuntu 18.04 LTS].
[Figure 5] Go to Microsoft Store and select Ubuntu 18.04 LTS
(2)
Obtain Ubuntu 18.04 LTS by clicking [Get]. Once obtained, click [Pin to Start].
[Figure 6] Click [Get] to obtain Ubuntu 18.04 LTS
(3)
Click [Ubuntu 18.04 LTS] from [Start] in Windows 10. The Ubuntu terminal will launch, set a "User Name" and "Password" and complete the installation.
[Figure 7] Ubuntu 18.04 LTS startup
3. Update/Manage packages using the "apt-get" command in the Ubuntu environment of WSL
To update packages, execute the following commands.
● sudo apt-get update
Update package information.
This command retrieves the latest package information from the Internet and updates the local package information.
● sudo apt-get upgrade
Update the package itself.
Based on the package information obtained from update, check if the locally installed version of the package is the latest, and if there is an older version, download and install the updated package.
Below are the steps to update the package.
(1)
If you have a proxy, such as an internal network, make the following proxy settings before apt-get.
(i) Edit the /etc/apt/apt.conf file using a vi editor
$ sudo vi /etc/apt/apt.conf
(ii) After starting the vi editor, type "i" to enter the input mode, and add the following proxy settings.
Acquire::http::proxy "http://your.proxy.address:proxy.port";
Acquire::https::proxy "https://your.proxy.address:proxy.port";
Acquire::: ftp::proxy "ftp://your.proxy.address:proxy.port";
Note:
In the above proxy configuration, your.proxy.address means the proxy address and proxy.port means the proxy port number..
(iii) To write and exit, press the ESC key once to enter command mode, and type in ":wq" (for more information on how to use the vi editor, please check Google search).
[Figure 8] Configuration when there is a proxy in the company network, etc.
(2)
Update package information.
$ sudo apt-get update
[Figure 9] Execute sudo apt-get update command to update package information
(3)
Execute the sudo apt-get upgrade command to update the package.
$ sudo apt-get upgrade
[Figure 10] Execute sudo apt-get upgrade command to update package information
(4)
If the following message is displayed during Upgrade, select [No] and Enter, then select [Ok] and Enter.
[Figure 11] If the following message is displayed during Upgrade
4. Mount the removable drive (if necessary)
For reference, here is an example of mounting/unmounting a removable drive with WSL.
a) Example of mounting a USB drive in WSL that is accessed as a local D: drive
$ sudo mkdir /mnt/usb Create a mount point
$ ls -l /mnt Verify that it has been created
$ sudo mount -t drvfs d: /mnt/usb Mount
$ ls /mnt/usb Check the contents of the mounted drive
$ df /mnt/usb Check the volume size of the mounted drive
[Figure 12] Example of mounting a USB drive (D: drive) with WSL
b) Example of unmounting a USB stick from WSL
$ sudo umount /mnt/usb/ Unmount
In the next article, [Part 2: Build], we will explain how to actually build Preloader/U-boot on WSL.