Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Linux » How to Setup GitLab Runner on WSL
  • SUBVERSION FEATURE
    How to Install Apache Subversion on a Linux System Linux
  • Task Scheduler Errors and Success Codes
    All Task Scheduler Errors and Success Codes Windows Server
  • How to Find Out Which Users Are Logged on Windows Server
    How to Find Out Which Users Are Logged on Windows Server Windows
  • ackup Repository and Add HyperV to VBR Inventory
    Create local Backup Repository and Add HyperV to VBR Inventory Backup
  • Watchguard Firewall 180504 100511 1
    WatchGuard Firebox XTM Device Image Backup Network | Monitoring
  • ddf
    How to configure Windows Deployment Services on Windows Server Windows Server
  • UEFI vs BIOS What's the Difference
    What are the Differences between UEFI and BIOS Windows
  • image 10
    How to use Microsoft SQL Server Management Studio to Export and Import your MsSQL database from Azure to local computer AWS/Azure/OpenShift

How to Setup GitLab Runner on WSL

Posted on 26/06/202301/07/2023 Imoh Etuk By Imoh Etuk 2 Comments on How to Setup GitLab Runner on WSL
GitLab-1
Setup GitLab Runner on Windows WSL

In this post, I will show you the steps on how to Setup GitLab Runner on WSL. Windows Subsystem for Linux is a feature of Windows that allows developers to run a Linux environment. It takes away the burden of setting up a separate virtual machine or dual booting.  It is assumed that you already have WSL set up on your Windows Machine. If you have not done so, review the post on Installing Ubuntu 20.04 LTS on Windows via WSL. Please see How to uninstall GitLab from your Windows device, WSL: What is Windows Subsystem for Linux, How to install Windows Subsystem for Linux on Windows 11 via the Command line, and Microsoft Store, and hoe to fix “WSL Error 0x8007019e: WSL Registrater Distribution failed with error“.

What is GitLab?

Similar to GitHub, GitLab offers a location for online code storage and capabilities for issue tracking and CI/CD. The repository enables hosting different development chains and versions and allows users to inspect previous code and roll back to it in the event of unforeseen problems. Teams can reduce product lifecycles and work more productively with the aid of GitLab, which benefits customers. Users of the program are not required to control tool authorizations individually. Everyone in the organization gets access to every component if permissions are only specified once and then, you can archive, unarchive or delete a GitLab Project.

Using GitLab comes with some additional benefits. It provides team members with the ability to collaborate throughout every stage of the project. GitLab enables tracking from conception to completion to assist developers in automating every step of the DevOps lifecycle and achieving the best outcomes. GitLab’s extensive feature set and open access to code blocks have drawn more and more developers to the platform. With GitLab, you can Install Docker Desktop and register GitLab-Runner with Docker-windows executor.

Setting up GitLab Runner

If you’re not self-hosting, and are instead using GitLab’s online SaaS solution, then you’ll need to pay for CI/CD minutes.  Using self-hosting requires setting up a GitLab Runner on a server and configures it as a build agent. This is ideal for auto-scaling multi-server deployments. It is available as a binary as well as a Kubernetes deployment, which may

This may be used for an auto-scaling multi-server deployment and is available as binary and Kubernetes deployment. Let’s get started by setting up the GitLab Runner on our machine following the steps below. You can also learn how to unregister a GitLab Runner.

Step 1: Launch the Ubuntu 20.04.16 LTS using the WSL through the Windows Command Prompt

Launching-Ubuntu-on-WSL
Launching Ubuntu through WSL

Step 2: Download the GitLab Runner

curl -LJO "https://gitlab-runner-downloads.s3.amazonaws.com/latest/deb/gitlab-runner_amd64.deb"
Download-GitLab
Downloading GitLab Runner

Step 3: Install the file using by running:

sudo dpkg -i gitlab-runner_amd64.deb

Next, you’ll need to configure it with the URL and token found in /admin/runners. To do this, run the below command:

sudo gitlab-runner register
Registering-gitlab-runner
Registering GitLab Runner

Step 4: Start the GitLab Runner

sudo gitlab-runner start

Run sudo service gitlab-runner status to verify that the GitLab runner is running.

/etc/init.d/gitlab-runner: invalid arguments
[FAIL] could not access PID file for GitLab Runner ... failed!

If you receive an an error as shown above proceed to modify the /etc/init.d/gitlab-runner file running he below command by the /usr/bin/gitlab-runner as shown in the screenshot below:

sudo nano /etc/init.d/gitlab-runner
Rectifying-error-of-gitlab-service-not-running
Modifying the /etc/init.d/gitlab-runner file

Now run the sudo service gitlab-runner status command to verify that GitLab runner is running. You can also confirm the version by running :

sudo gitlab-runner -version
check-version-service
GitLab Service

You can verify the GitLab Runner from your GitLab project:

Confirming-a-runner-in-GitLab
Verifying GitLab Runner in the Project

You can also verify the Runner by running sudo gitlab-runner list and can also create another GitLab Runner with with the same token:

Creating-another-GitLab-Runner
List of GitLab Runners

To prepare the runner for CI/CD jobs, you will need to open the settings for the runner, and set proper tags for it that will get picked up by matching gitlab-ci.yml config files. If you do not want to bother about tags, you can check the box that indicates here to pick up untagged jobs:

Setting-tags
Managing Tags in GitLab Runner
The next thing is to configure your projects to use this runner. That's all!

I hope you found this blog post helpful on how to Setup GitLab Runner on WSLL. Please let me know in the comment section if you have any questions.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Linux, Windows Tags:GitLab, Ubuntu

Post navigation

Previous Post: How To Use Logrotate For Managing Log Files In Ubuntu Linux
Next Post: Build a Scalable VPC for Your AWS Environment [Part 1]

Related Posts

  • Prevent Local Administrators from turning off BitLocker 1
    Prevent Local Administrators from managing BitLocker with the manage-bde command Windows
  • MDT Workbench Crashes when opening WinPE tab Properties
    Fix MDT Workbench Crashes when opening WinPE tab Properties Windows
  • Featured image 2
    Enable Microsoft Defender SmartScreen: How to prevent Exe files from getting deleted randomly in Windows 10 and 11 Security | Vulnerability Scans and Assessment
  • Windows 10 new Start menu
    Make Cortana search with a different web browser instead of Edge Windows
  • fast user switching in windows 10 2
    To enable or disable fast User Switching in Windows 10 Windows
  • How To Upgrade Windows 11 Pro to Enterprise
    Upgrade Windows 11 Pro to Enterprise and vice Versa Windows

More Related Articles

Prevent Local Administrators from turning off BitLocker 1 Prevent Local Administrators from managing BitLocker with the manage-bde command Windows
MDT Workbench Crashes when opening WinPE tab Properties Fix MDT Workbench Crashes when opening WinPE tab Properties Windows
Featured image 2 Enable Microsoft Defender SmartScreen: How to prevent Exe files from getting deleted randomly in Windows 10 and 11 Security | Vulnerability Scans and Assessment
Windows 10 new Start menu Make Cortana search with a different web browser instead of Edge Windows
fast user switching in windows 10 2 To enable or disable fast User Switching in Windows 10 Windows
How To Upgrade Windows 11 Pro to Enterprise Upgrade Windows 11 Pro to Enterprise and vice Versa Windows

Comments (2) on “How to Setup GitLab Runner on WSL”

  1. Avatar photo Ainsof So'o says:
    26/06/2023 at 11:58 PM

    Hi thanks for the tutorial. I noticed that you selected docker for the gitlab runner but you didnt include a step/note to install docker. Is docker required when you select it for the gitlab runner?

    Log in to Reply
    1. E Imoh1 Imoh Etuk says:
      27/06/2023 at 8:38 PM

      Hi Ainsof,
      Thanks for your comment!
      In this case, Docker is used the host for the gitlab-runner. Once docker is selected, it becomes an executor for the gitlab-runner, and this case, you don’t need to install docker again. In my next writeup, I will demonstrate how to build Docker images in a GitLab CI Pipeline.

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a
 
  • SUBVERSION FEATURE
    How to Install Apache Subversion on a Linux System Linux
  • Task Scheduler Errors and Success Codes
    All Task Scheduler Errors and Success Codes Windows Server
  • How to Find Out Which Users Are Logged on Windows Server
    How to Find Out Which Users Are Logged on Windows Server Windows
  • ackup Repository and Add HyperV to VBR Inventory
    Create local Backup Repository and Add HyperV to VBR Inventory Backup
  • Watchguard Firewall 180504 100511 1
    WatchGuard Firebox XTM Device Image Backup Network | Monitoring
  • ddf
    How to configure Windows Deployment Services on Windows Server Windows Server
  • UEFI vs BIOS What's the Difference
    What are the Differences between UEFI and BIOS Windows
  • image 10
    How to use Microsoft SQL Server Management Studio to Export and Import your MsSQL database from Azure to local computer AWS/Azure/OpenShift

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,841 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.