Environment Setting

We're aiming to create a knowledge hub for 3D printing of the future.

Mac OS X

1. Install command-line tools for Xcode

Open terminal and type in

$ xcode-select --install. This will bring up a pop-up window. Select “install”

(don’t type the $ -that’s a placeholder for whatever your prompt is)

2. Make a Work Directory

When you open Terminal.app the shell will start up at your home directory. Issuing

$ pwd

Will print


If you issue

$ ls

It will print the contents of your home folder(home directory), which may have a lot of things, including your Documents folder, Pictures folder, etc.

3. Install visual studio code


The hotkey combination for starting a terminal shell within vscode on Mac OS is


Windows 10

1. Active Windows Subsystem for Linux

Open the control panel. Select Turn “Windows features on or off. Check the box “Windows Subsystem for Linux”. Then reboot for this to take effect.

2. Install Ubuntu

After reboot, go to the Microsoft Store and search for “ubuntu” (In this time, we choose 20.04). Choose the last version and install it.

launch Ubuntu, it will show “Installing”. It may take a few minutes. After installation, it will request you to set your username and password. You can type in anything you want. (this account is completely within the Windows Subsystem for Linux universe and has nothing to do with your account on the host computer). Also, when you type in your password, it might show nothing in the bash shell. Don’t worry, just use “Enter” to decided your password.

Please take care of your username and password.

After setting, use command exit to exit and logout from bash.

3. Connect Linux subsystem with Windows 10

The Linux subsystem has its own world. So, you can not see its files and folder through Windows Explorer. However, vscode works in the Windows space, we need to connect the two.

In order to do that, create a folder as your home directory under Windows Subsystem for Linux (WSL).

First, open Ubuntu and type in sudo apt update.

apt is an update command, that will update you are the Ubuntu package manager. So, you can download and install packages. Since apt command requires elevated privileges, so the sudo is used to allow the subsequent command is executed under elevated privileges.

Then, install the “nano” text editor by type the following

sudo apt-get install -y nano

nano will help use to configure the WSL filesystem.

Next, type

sudo nano /etc/wsl.conf

It will open a privileged file like below.

Type in the following

options = "metadata"

Also, put a new line after the second line. Then, use Ctrl+O to save the file. Use “Enter” and exit by Ctrl+X

Second, Close all WSL windows. Then open a command windows (not bash), type in

wsl --shutdown

This will shutdown WSL on your system. When we start it again, it will have the new settings we just established.

Next, in the command window, type the following

wsl -u root

You should get back something like

root@device:/mnt/c/Users/<your win10 id>#

Now, type

usermod -d /mnt/c/Users/<win10id>/Documents/<file name> -m <userid>

It will looks like below

root@device:/mnt/c/Users/<your win10 id># usermod -d/mnt/c/Users/<your win10 id>/Documents/<file name> -m <user id>

Where <file name> is any file name you like (you should create this file before type in the command). <user id> is your WSL’s username which we created in “2. Install Ubuntu” section. Besides, you should remove < and > when you type in. This is because they are place-holder.

This will create a new directory in your documents folder called <file name>. <file name> will be your home directory under WSL.

*Again, there is two user id. First is your windows 10 user id. Another is your Windows Subsystem for Linux (WSL) user id. Also, if you want to use the windows command, please type command in your start menu. Otherwise, if you want to use WSL, please type bash in your start menu or use Ubuntu.

Also, if you are using OneDrive on your Windows 10. you can use below command

root@device:/mnt/c/Users/<your win10 id># usermod -d '/mnt/c/Users/<your win10 id>/OneDrive -<file name>' -m <userid>

Next, type exit to exit and then close the command window.

Check your setting

Now, let’s check your home directory was set.

Open a WSL window (open bash or Ubuntu from your start menu).

  • For bash, it might print system directory. Type the following command in your WSL window


For Ubuntu, type in


It will print the directory we just created above.

If you type ls, it will show nothing. But if you type ls -a, you can see some dot files. They are configuration files and normally hidden.

Now, you have connected Linux Subsystem with Windows 10. In the next step, we are going to install your development tools.

4. Install your development Tools

First, let install some package by command apt and apt-get

Type in the following sequence of commands:

sudo apt-get update
sudo apt-get install apt-utils
sudo apt-get install clanglldb man make net-tools ssh wget

Answer “Yes” in all your processing.

When you finish the installation. You may want to type

c++ --version

to check clang is installed in your device.

5. Install Visual Studio Code

Use next link to download proper version. https://code.visualstudio.com/download

After installation, let’s customize some settings.

Click the manage button (a gear icon) and select “command platette…”, type “Terminal: Select Default Profile”. Select “WSL Bash”

Now from the top menu bar (like below image) open a new “terminal”. Or use Ctrl+ \ to start a terminal.

Then, type in cd in your terminal to go to your home directory which we created above.

Finally, open the extension panel with key combination Ctrl+Shift+s. Or click on left extension icon (shows below)

type in C++ intellisense to search it. Once you find it, click on install to install in.