Home Virtual machine on Windows
Post
Cancel

Virtual machine on Windows

As I program more, I find linux system is more efficient for my work. However, windows is still a good option in terms of everyday use. Thereby I come up an idea that why not have two systems on one machine, and I can use linux for working and windows for other use. Here is how I configurated it. I take a note on the process in case of any need again in the future.

Installing Virtual machine

To have a virtual OS on the laptop, we have to install a virtual machine software where we can emulate the system. THe installation instruction can be found here Use VirtualBox mainly because it’s free and light! Plus, it’s very friendly to new users.

Setting up system

  1. In VirtualBox, go for setting, find Shared Folder menubar and click it. On the right side, add new shared folder and select the folder path, remember to check the box of auto-mount. You can also name the shared folder.
  2. Then remember to set your root password. When you log in the Ubuntu, for example, you only need to set up the username as well as its password. However, this is not your root password. In order to get the admin access, enter su root passwd in the terminal. Afterwards, enter you first type your own user password and then type your new root password.
  3. It’s time to make the shared directory. sudo mkdir <the shared folder path you want to build>
    sudo mount -t vboxsf <name of the shared folder(which you named in step 1)> <shared folder path set above> OK, now if you use ls to check the current files and folders, you’ll find the shared folder with a green background box.
  4. Unfortunately, it always requires the mount command every time you reopen the machine. I didn’t figure out how to make it auto mount under the root setting. But I set an alias in .bashrc file so that user can just type a short command to repeat it. add the command alias <a command name you like>='sudo mount -t vboxsf <name of the shared folder(which you named in step 1)> <shared folder path set above>'.
  5. Now you’re ready to go! We can edit the files on both systems and they are shared!

Push to Github on linux

  1. Just follow the SSH blog.
  2. Git clone your repo.
  3. The terminal may pop up some , asking who are you. Then you need to git config --global user.name <YOUR_NAME> git config --global user.email "<YOUR_EMAIL>
  4. Great! Now we can add or modify files of the repository! With an external monitor, we even can operate two systems on the same machine. I feel it looks pretty cool and boosts my productivity!

Some useful links:

https://askubuntu.com/questions/161759/how-to-access-a-shared-folder-in-virtualbox

https://linuxconfig.org/how-to-set-a-root-password-on-ubuntu-22-04-jammy-jellyfish-linux

This post is licensed under CC BY 4.0 by the author.

Power BI practice for data visualization

Logistic Regression