DEV Community

Haripriya Veluchamy
Haripriya Veluchamy

Posted on

Setting Up Ubuntu Linux on Windows: A Developer's Guide

Hey there! πŸ‘‹ If you're reading this, you're probably looking to set up Ubuntu on your Windows machine without using WSL. I recently went through this process myself, and I want to share my experience to make it easier for you.

What We'll Be Doing

We'll install Ubuntu on Windows, get it properly configured, and connect it to VS Code. Trust me, once this is set up, you'll have an awesome development environment that gives you the best of both Windows and Linux.

Getting Started

First things first, head over to Ubuntu's website and download the desktop version. While that's downloading (it might take a while depending on your internet speed), let's go through what we'll need:

  • Some free space on your computer
  • VS Code installed on Windows
  • A bit of patience (and maybe some coffee β˜•)

The Installation Process

Once you've got Ubuntu downloaded, open up the image and follow the installation wizard. It's pretty straightforward, but don't rush through it. Take your time to read each screen - we want to get this right the first time!

First Boot and Initial Setup

Here's where things get interesting. When you first boot into Ubuntu (just search for it in Windows), you might notice that some essential tools are missing. Don't worry, this is normal! Here's what we need to do:

  1. First up, we need to set a root password. You'll need this for admin tasks:
   passwd
Enter fullscreen mode Exit fullscreen mode

When it asks for a new password, make it something you'll remember but others won't guess!

  1. Now, you might be surprised to find that sudo isn't installed. This threw me off the first time too! Here's how to fix that:
   su -
   apt-get update
   apt-get install sudo
   usermod -aG sudo your_username    # Replace 'your_username' with yours!
   exit
Enter fullscreen mode Exit fullscreen mode

Quick tip: You'll need to log out and back in for this to take effect.

  1. Let's make sure sudo is working:
   sudo whoami
Enter fullscreen mode Exit fullscreen mode

If this shows your username, you're golden!

  1. Time to install some essential tools:
   sudo apt update
   sudo apt install net-tools openssh-server
Enter fullscreen mode Exit fullscreen mode

Setting Up VS Code Remote Access

This is where the magic happens! We're going to set up VS Code so you can work on your Ubuntu system from the comfort of your Windows VS Code setup.

  1. First, find your Ubuntu IP address:
   ifconfig
Enter fullscreen mode Exit fullscreen mode

Look for the eth0 section and note down that IP address.

  1. In VS Code on Windows, install the "Remote - SSH" extension. Trust me, it's a game-changer!

  2. Here's the important part - we need to set up the SSH config. Press Ctrl + Shift + P, type "Remote-SSH: Open Configuration File" and add this:

   Host ubuntu-dev
       HostName your_ubuntu_ip_address
       User your_username
       RemoteCommand /bin/bash
       RequestTTY force
       HostKeyAlgorithms +ssh-rsa
       PubkeyAcceptedKeyTypes +ssh-rsa
       ForwardX11 yes
       ForwardX11Trusted yes
Enter fullscreen mode Exit fullscreen mode

(Don't forget to replace your_ubuntu_ip_address and your_username with your actual details!)

Connecting Everything

Now for the moment of truth! In VS Code, hit Ctrl + Shift + P again, type "Remote-SSH: Connect to Host" and select your Ubuntu setup. If everything's set up correctly, you should be able to connect!

Troubleshooting

If things aren't working quite right:

  • Double-check your IP address - these can sometimes change
  • Make sure SSH is running: sudo service ssh status
  • Check your firewall settings
  • Try restarting VS Code (yes, sometimes the classic "turn it off and on again" actually works!)

You're All Set!

That's it! You now have a fully functioning Ubuntu setup accessible right from VS Code. Pretty cool, right? Feel free to customize it further to match your workflow.

Happy coding! πŸš€

Top comments (0)