Set up your Linux practice environment
Download original fileASIC Campus does not provide a terminal in the browser. You practise this course on a Linux system you control: a Linux computer, WSL2 on Windows, or a virtual machine. Setting one up takes 15 to 60 minutes, depending on the option. Choose one option below, install the course packages, then run the checks at the end.
The lessons use CentOS Stream 10 as their reference system. Any current Linux distribution works for the exercises. Where commands differ, such as rpm and dpkg in lesson 08, the lesson shows both.
Choose where to practise
| You have | Use | Notes |
|---|---|---|
| A Linux computer | Native Linux | The simplest option. Any current Ubuntu LTS, Debian, Fedora, Rocky Linux, AlmaLinux or CentOS Stream release is fine. |
| Windows 10 or 11 | WSL2 with Ubuntu LTS | Runs a real Linux system beside Windows, with no separate virtual machine to manage. |
| Windows, macOS or Linux, and you want an isolated system | A virtual machine with Ubuntu LTS | Use VirtualBox, or UTM on a Mac. The safest place to experiment because it is completely separate from your own files. |
| macOS only | A virtual machine (recommended) | macOS is not Linux. See the macOS notes below. |
A shared computer at your university or employer may already have the tools. Do not install packages on it yourself. Ask its administrator, and use the checks at the end of this guide to record what is available.
Native Linux
Open a terminal and continue with "Install the course packages". If you are not sure which distribution you have, run cat /etc/os-release.
WSL2 on Windows
- Open PowerShell with Run as administrator and run:
powershell
wsl --install
This installs WSL2 with Ubuntu by default. Restart Windows when asked. wsl --list --online shows the other distributions you can install.
2. Open Ubuntu from the Start menu. On first start it asks for a Linux user name and password. These are separate from your Windows account; the password is the one sudo asks for.
3. Keep your course work in your Linux home directory (~, which is /home/your-name), not under /mnt/c. Files on the Windows drive are slower, and chmod does not normally change their permissions, so lesson 04 will not behave as described.
4. To copy a file you downloaded in Windows into Linux, run the following in Ubuntu, replacing YourWindowsName with your Windows user folder name:
bash
cp /mnt/c/Users/YourWindowsName/Downloads/linux-self-check.sh ~/
WSL notes:
- Graphical programs. Windows 11 runs Linux graphical programs such as GTKWave directly (this feature is called WSLg). On Windows 10, keep the VCD file and view it later on a system with a display; lesson 15 explains this case.
- Services. Lesson 09 uses
systemctlandjournalctl, which need systemd. Recent WSL releases start systemd for Ubuntu. Ifsystemctlreports that the system was not booted with systemd, read lesson 09 without running those commands, or use a virtual machine.
A virtual machine
- Install a virtualization program: VirtualBox on Windows, Linux or an Intel Mac, or UTM on a Mac with Apple silicon.
- Download the Ubuntu Desktop LTS installer image from ubuntu.com. On an Apple silicon Mac, choose the ARM64 build.
- Create a virtual machine with at least 2 CPU cores, 4 GB of memory and 25 GB of disk, attach the installer image, and install Ubuntu with the default options.
- Log in, open Terminal, and continue with "Install the course packages".
The installer creates your user with permission to use sudo. A virtual machine is separate from your own computer, so a mistake inside it cannot damage your files outside it.
macOS notes
The macOS Terminal runs a Unix shell, but it is not Linux, and many commands in this course behave differently:
- macOS uses BSD versions of
stat,sed,dateand other tools, so options such asstat -candsed -ibehave differently or fail. - There is no
systemd, sosystemctlandjournalctldo not exist; there is norpm,dnforapteither. - The default shell is zsh, not Bash.
Use a virtual machine for the course. If you use macOS directly anyway, expect differences from the expected results, and do not report them as course errors.
Install the course packages
Installing packages on your own computer, WSL system or virtual machine is the one place in this course where you use sudo. Everywhere else, the lessons ask you not to use it.
| Package | Used in |
|---|---|
git |
Lesson 14: project organization and version control |
make, python3 |
Lessons 05, 08 and 12: tool lookup, versions and build tools |
iverilog (provides iverilog and vvp) |
Lessons 12, 13 and 15: Icarus Verilog compile and simulation |
gtkwave |
Lesson 15: viewing the waveform (optional; needs a display) |
vim, nano |
Lesson 13: editors |
tree, ripgrep (rg), file, rsync |
Lessons 02, 03 and 10: inspection, search and copy tools (tree and rg are optional) |
Most systems already include the core tools the lessons use, such as bash, grep, sed, awk, find, tar and sha256sum.
Ubuntu and Debian (including WSL)
sudo apt update
sudo apt install -y git make python3 iverilog gtkwave vim nano tree ripgrep file rsync
Fedora
sudo dnf install -y git make python3 iverilog gtkwave vim-enhanced nano tree ripgrep file rsync
RHEL, Rocky Linux, AlmaLinux and CentOS Stream
Icarus Verilog, GTKWave and ripgrep are not in the base repositories of these distributions. They come from EPEL (Extra Packages for Enterprise Linux). On Rocky Linux, AlmaLinux and CentOS Stream, enable it and install the packages:
sudo dnf install -y epel-release
sudo dnf install -y git make python3 iverilog gtkwave vim-enhanced nano tree ripgrep file rsync
Some EPEL packages depend on the CRB repository. If the second command reports missing dependencies, enable CRB with sudo dnf config-manager --set-enabled crb and run it again.
On Red Hat Enterprise Linux itself, enable EPEL by following the instructions in the EPEL documentation for your release, then run the second command. If dnf reports "No match for argument" for a package, that package is not yet built for your release. Install the rest, record the missing package, and use an Ubuntu LTS virtual machine for the lessons that need it.
Verify your environment
Create the practice directory that the lessons use, then check each tool. command -v prints the path of a tool that is installed and prints nothing when it is missing.
mkdir -p "$HOME/asic-linux-practice"
cat /etc/os-release
bash --version | head -n 1
git --version
make --version | head -n 1
python3 --version
command -v iverilog vvp gtkwave vim nano
iverilog -V 2>&1 | head -n 1
Expected result: each version command prints one line, such as git version 2.43.0 or Python 3.12.3, and iverilog -V prints a line beginning Icarus Verilog version. Your version numbers will differ. command -v prints one path for each installed tool. A missing optional tool, such as gtkwave on a system without a display, is fine; write it down.
Check your work with the self-check script
The course includes a self-check script, linux-self-check.sh, in the course's reference material list. Download it, then read it before you run it, as you should with any script from the internet:
less ~/linux-self-check.sh
The script only reads files. It never creates, changes or deletes anything, needs no sudo, and does not use the network. It looks only inside ~/asic-linux-practice, and it does not run your scripts or simulations. It prints one PASS, FAIL or SKIP line per check, and a hint after each FAIL.
Check your tools now:
sh ~/linux-self-check.sh setup
After each lesson's worked example and practice, check that lesson by its number:
sh ~/linux-self-check.sh 02
| Command | Checks |
|---|---|
setup |
Course tools and the practice directory |
02 |
Practice directory, symbolic link, project tree, and the copied note from the practice |
03 |
logs/run.log and the files produced from it |
04 |
scripts/run.sh permissions, and report.txt with mode 600 from the practice |
05 |
project/ and tools/bin/ |
07 |
evidence.tgz contents and its SHA-256 checksum file |
12 |
evidence/ lookup record and checksums |
13 |
editor-lab/ counter module and testbench skeleton |
14 |
counter-project/ tree, file lists, .gitignore, staged files and no remote |
15 |
Compile output, simulation log with TEST PASS count=5, VCD file and scripts/run_sim.sh |
all |
Everything above |
Lessons 01, 06, 08, 09, 10 and 11 have no check. Their exercises inspect your system or ask you to write things down, so there are no fixed files to check.
To check a different practice directory, give it as a second argument, for example sh ~/linux-self-check.sh 02 ~/my-practice. The script refuses to check / or your whole home directory.
The script confirms files, permissions and results. It does not mark your written answers or explanations; compare those with each lesson's expected result.
If something goes wrong
| Problem | What to do |
|---|---|
sudo: command not found or "not in the sudoers file" |
You are not an administrator on this system. Ask the system's administrator, or use WSL or a virtual machine, where you are. |
E: Unable to locate package iverilog |
Run sudo apt update first, then install again. |
No match for argument: iverilog on a RHEL-family system |
Enable EPEL as described above, or use an Ubuntu LTS virtual machine. |
| GTKWave reports that it cannot open a display | Use a desktop session, Windows 11 with WSLg, or a virtual machine with a desktop. Keep the VCD file and view it later. |
chmod has no effect in WSL |
Your files are under /mnt/c. Move your practice directory into your Linux home directory. |
The self-check prints FAIL for a file you created somewhere else |
The script looks in ~/asic-linux-practice using the names in the lessons. Repeat the step there, or give your directory as the second argument. |