Skip to main content

Home-Based Linux Work with VPN on macOS

Updated by Tim Rabbetts on
lmac vpn via linux

Being a passionate developer with a penchant for the Linux environment, I aimed to continue my work seamlessly from home. However, a specific project mandated the use of a VPN accessible only through my work MacBook running macOS. I experimented with various solutions such as employing the Mac as a proxy, creating a virtual desktop, and attempting code synchronization through Samba. Unfortunately, none of these approaches proved satisfactory.

 

The proxy attempt was thwarted by VPN restrictions prohibiting such actions. The Samba share proved inefficient due to speed issues, and the virtual desktop approach contradicted my desire for a Linux environment. Ultimately, I found a successful solution by setting up an SSH server on the MacBook and using Visual Studio Code to enable remote file editing over SSH. This method is not only swift but also functions flawlessly.

 

Now, with both the code and web server running in Docker on the Mac, I encountered difficulties accessing the server due to closed ports. To overcome this hurdle, I granted Docker ports the necessary permissions. I simplified the process by adding an entry in my hosts file, directing mytestdomain.test to the Mac's IP on my network. Leveraging the Remote SSH extension in Visual Studio Code, I seamlessly access and edit the code in real-time on my MacBook.

 

Everything is now working seamlessly, although I occasionally need to re-login to the VPN. I share this solution in the hopes that it proves helpful to others seeking to utilize their home Linux environment.

Add new comment