← Home

Windows as my work machine

Last month after traveled to japan my MacBook Pro just went dead. It cannot charge and cannot turn on. I have to send in for servicing which took a few days. So I think it might be a good time to try out Windows machine and see can it replace my work machine.

Tools #

Most of my works are web development, some are kind of ops which is just configure AWS EC2 instance and deploy the code into production. Tools that I use most on my Mac are

Applications above can find alternative or have Windows version but some are not as good compare to the macOS because of few things, file system (macOS doesn’t have drive concept, file permission which Windows has a completely different view of it) So instead of

Docker #

I use Docker a lot both development and production. Development I also use it as developer machine in remote (AWS ECS, I think most people don’t use Orchestration as development machine management but the setup itself I think can write into another blog post)

And because it’s docker image, I can run it on local machine too by just pull the image and configure it similar to the on in remote. The issue is, the container itself also need docker host for building application when I want to deploy application. Normally this can be done by just passing docker file socket in macOS but Docker for Windows doesn’t provide that file and expose the tcp socket instead.

To expose daemon, have to go to Docker settings and enable the last option in general tab (Expose daemon without TLS)

Another issue is, docker daemon on Windows only expose the socket on localhost only. So I need to forward port to allow container to talk to Docker host. In linux or macOS, this might be just ssh local forward (I think it might have another option instead of forward the port by ssh) on Windows, there’s network shell for doing this.

netsh interface portproxy add v4tov4 listenport=2375 listenaddress=10.0.75.1 connectaddress=127.0.0.1

So from above command, I just forward 10.0.75.1:2375 to localhost:2375 the connect port can be ignore if the port number is the same. This forward is stick in the system and will be there after restore. To remove, just run

netsh interface portproxy delete listenport=2375 listenaddress=10.0.75.1

Other than tools list above, I install it inside the linux. (rvm and ruby, nvm and nodejs, awscli, python.) The good thing of Linux subsystem is, it expose the windows drive inside too. So my workflow on Windows is just changing the files with VSCode on windows and running rails or node.js app (webpack dev server) inside the linux. When save the file, it will trigger the change inside the linux and cause those app to reload the file. The same as Docker which I will mount the drive into the container.

For a first few weeks I start with Docker and prefer to develop in it (almost exact same as production/remote developer machine environment) but it does seems docker for Windows has some limitation that cause the container corrupt and I have to reset it a few times. In the last few weeks I move to running everything inside the linux subsystem and seems fine so far. The file permission is feel weird (everything is 755 or 777) but as long as it’s not get commit into the repository should be fine.

iOS Safari #

This is the main blocker that stopping me from using Windows machine. I can use my Phone for testing however, to debug and see how’s the page is rendering is quite troublesome. The most useful tool I can find so far is RemoteDebug iOS adapter but it really cannot compare to the simulator in XCode and Safari remote debugger at all. Not sure how can this be solve but at least still be able to test when I have the hardware.

Conclusion #

I already got my MacBook back for sometime and already switch back to it for work machine. I think if I don’t need to work with iOS that much I might be able to switch to Windows machine completely. I like the Dell hardware and Microsoft design keyboard and mouse (except the keyboard layout that’s quite too pack) I hope Apple will consider to remove touch bar and make non-touchbar more powerful than current state. (The touchbar is really useless for me when I always connect to external monitor.)

So I might consider again, but for now still have stick with MacBook for awhile.

Send a comment

← Home