Every developer has set of software and tools that he uses for work or hobby. This set could contain favorite IDEs, packages, libraries and useful tools. Over time, this list of software grows. At some point the set gets on so large that developer can not hold all of it in his memory. That is how “developer memory dump” appears - text file with list of necessary software.
Time goes by. Developer gets new work, upgrade his (or her) PC… After several iterations of installation of tons of software on clean OS, developer asks himself - how he can optimize this routine? One of the answers is to use virtual machine. Main idea is simple: you set up virtual machine with OS and all required software only once and then use it on (almost) every computer. I call such virtual machine Virtual Developer OS (VDOS).
Advantages of VDOS:
Disadvantages:
In this post I will describe how to create VDOS. In the first part you will learn how to create virtual machine using VirtualBox. The second part will contain setup commands that I use when create my own VDOS.
I assume that host OS and virtual OS are Linux (Ubuntu).
VirtualBox - is a hypervisor for PC from Oracle Corporation. Main advantage - it can work on Windows, Linux and other OSes.
Install VirtualBox:
cd /path/with/virtualbox/install/file
sudo dpkg -i virtualbox.deb
As a VDOS we will use Ubuntu. I would recommend to use latest Desktop LTS release. You can download it here.
As a result of these steps you will get empty VDOS with name “UbuntuVDOS”. Choose it and press “Settings” button.
Now we made all preparations for installation of Ubuntu on virtual machine. Choose “UbuntuVDOS” in VirtualBox and press “Start” button. Virtual machine will start to load and soon you will see Ubuntu installation window.
After successful installation of VDOS, let’s fill it up with useful software.
Open Terminal and type this commands:
sudo apt-get update
sudo apt-get upgrade
With VirtualBox Guest Additions VDOS will work smoothly. Also this package will enable:
First of all, let’s install additional packages:
sudo apt-get intall linux-headers-$(uname -r)
I recommend to reboot your VDOS after this command so changes in OS could be applied.
After VDOS reboot check that virtual CD-drive of your VDOS is empty. Then choose in VirtualBox menu: Devices -> Insert Guest Additions CD image. VirtualBox will try to mount its “Guest Additions CD” into VDOS CD-drive. After that you will see a small window that will offer you to run installation script. Press “Run” button.
It is very likely that installation will go smoothly. If during installation something went wrong, read program output - you will get some hints what you need to do (for example, install missed packages).
After installation eject installation CD from virtual CD-drive and reboot VDOS.
One of the advantages of the VirtualBox is support of shared folders. It means that you can set some of the folders of your host OS to be shared with VDOS. You can share folders in read-only mode or give full access to them. This is very useful feature. For example, in host OS you can create folder with your projects and share it with VDOS. You would have only one copy of your projects and will be able to work with them in both OS-s.
Let’s share “Projects” folder with VDOS (with the help of this article):
sudo usermod -aG vboxsf user_name
For easy access/convenience, you may create a symbolic link to the mounted shared folder in your home folder:
sudo ln -s /media/sf_Projects /home/user_name/Projects
Before we start to install additional software to VDOS, I would recommend you to create snapshot of your VDOS. If something went wrong during software installation, you will be able to roll back any changes and start again. How to create snapshot:
sudo apt-get install mc htop synaptic screen gcc g++ \
make cmake gdb git subversion valgrind ubuntu-sdk \
icu-doc kdelibs5-data
sudo apt-get install qt4-bin-dbg qt4-default qt4-designer \
qt4-dev-tools qt4-doc qt4-doc-html qt4-linguist-tools \
qt4-qmake qt4-qmlviewer qt4-qtconfig lighttpd firebird-dev \
libmysqlclient-dev libpq-dev libsqlite0-dev libsqlite3-dev \
unixodbc-dev libxcb-doc libxext-doc qt-assistant-compat \
libqt4-sql-mysql libqt4-sql-psql libqt4-sql-odbc
sudo apt-get install qt5-default qt5-doc qt5-doc-html \
qt5-image-formats-plugins qt5-qmake \
qt5-qmake-arm-linux-gnueabihf qt5-style-plugins \
qttools5-dev-tools qtbase5-dbg qtbase5-dev-tools-dbg \
qtbase5-private-dev libqt5sql5-mysql libqt5sql5-psql \
libqt5sql5-odbc libqt5svg5-dev
sudo apt-get install qtcreator qtcreator-data \
qtcreator-dbg qtcreator-dev qtcreator-doc
The simpliest way to get Boost is to install it from Ubuntu repository. Current available version - 1.58. It’s quite old (04.2015), but stable and sufficient for most users.
sudo apt-get install libboost-all-dev
If you want to use latest version of Boost, go to Boost SourceForge page and download latest stable release of Boost. Extract content of the archive to /opt folder (for example, /opt/boost_X.X where X.X is a version number) and read manuals about how to use it (and build, if necessary):
I love IDEs from JetBrains and I think PyCharm is the best free IDE for Python. You can download it here (choose Community Edition). How to install PyCharm:
cd /path/with/pycharm/archive
# Extract archive
tar -zxvf pycharm-archive.tar.gz
# As a result we will get pychram folder. Let's move it into /opt
sudo mv ./pycharm /opt
# Run PyCharm. You will see set up window. Don't forget to choose option "Create Desktop shortcut for all users"
sudo /opt/pycharm/bin/pycharm.sh
# Add path to PyCharm */bin* folder to $PATH variable :
# PATH="$PATH:/opt/pychram/bin"
nano ~/.profile
# Log out and log in into OS. In terminal try to execute:
pycharm.sh
Another IDE from JetBrains. This time for Java. You can download it here (choose Community Edition and .tar.gz extension).
Installation process of IntelliJ IDEA is the same as the installation of PyCharm:
cd /path/with/idea/archive
# Extract archive
tar -zxvf idea-archive.tar.gz
# As a result we will get Idea folder. Let's move it into /opt
sudo mv ./idea /opt
# Run Idea. You will see set up window. Don't forget to choose option "Create Desktop shortcut for all users"
sudo /opt/idea/bin/idea.sh
# Add path to Idea */bin* folder to $PATH variable :
# PATH="$PATH:/opt/idea/bin"
nano ~/.profile
# Log out and log in into OS. In terminal try to execute:
idea.sh
Download Google Chrome package from here.
sudo apt-get install libindicator7 libappindicator1
cd /path/with/chrome
sudo dpkg -i google-sudochrome.deb
Congratulations! Now you have your own VDOS! First of all, I would recommend you to create new snapshot of VDOS. If you want to transfer VDOS to another computer: