Linux development setup on non-Linux environment (with VSCode)

Linux development setup on non-Linux environment (with VSCode)


C/C++

Hello Windows and macOS users!

Have you ever thought about learning C/C++, or low level programming in other languages? Perhaps you’ve even bought a book, or explored related blogs, only to discover at the end of the day that the resources you’ve gathered are tailored exclusively for Linux.

”Oh… this only works for Linux…”

Now, you’re faced with several options. The most costly one would be investing in dedicated hardware to fulfill your programming desire. Alternatively, you could set up a Linux virtual machine on your Mac or explore cloud-based solutions, among other possibilities.

Developing Inside a Container

Or, you can create a Linux container and bind your local folder on your Mac to the container, which is for free, and probably the fastest way to achieve it (if your choice of text editor is Visual Studio Code).

(It should work on Windows using the same way I haven’t tried it though)

Prerequisite

  • Visual Studio Code
  • and Docker Desktop

Steps

  1. #1: Start Docker Desktop (if you didn’t)
  2. #2: Install Dev Containers extension
  3. #3: In your VSCode, click “Open a remote window” button on the bottom left
  4. #4. Click “New Dev Container”. Then select the language of your choice (for example, ‘Go’). This will build a new Linux container for your development.
  5. #5. Be patient until it’s ready (it probably takes a few minutes…)

After finishing the steps above, you will see your dev container is up and running now!

Thanks for reading ✌️

© 2024 Hiro