Mischiefblog
I make apps for other people

Mint VM setup

Posted by Chris Jones
On December 30th, 2013 at 13:13

Permalink | Trackback | Links In |

Comments Off on Mint VM setup
Posted in Java, Tech

On Windows, use VMWare. I’ve run into problems with Oracle VirtualBox and Windows networking, although it works very well on Linux.

On the Thinkpad T420s I needed to enable VT-x (Virtualization support) in the BIOS setup under the Security-Virtualization menu.

VM Configuration
For a Core i5 vPro with four cores, I assign:

  • Four GB of RAM
  • Two processors
  • 32 GB of disk in a single file

Distribution Choice
On my hardware (Thinkpad T420s) I’ve had problems with Fedora. Ubuntu derived distributions work fine, including Linux Mint. I’ll assume that you’re using Linux Mint 16 Petra 64-bit.

I’ll download the .iso version via BitTorrent. Both VMWare and VirtualBox can mount and use ISO files for VM installation, plus it boots significantly faster than physical media.

Post-install VMWare Configuration
First, install the Linux kernal sources. VMWare’s install script will complain if you don’t have them, and VMWare’s install script will complain that it can’t find what it wants when you do install them.


sudo apt-get install linux-kernel-headers

Verify the headers are installed by looking in /usr/src

Second, install the VMWare tools: VMWare should be bugging you about this in the VM window toolbar. This will include significant quality of life improvements such as a shared clipboard and dynamic screen resizing: I found modern X.org builds have been cranky when it comes to configuring the monitor resolution on a VM. VMWare will install the vmware-tools-distrib on your desktop: expand it if necessary, then run the vmware-install.pl script either in a shell with sudo ~/Desktop/vmware-tools-distrib/vmware-install.pl or with the right-click context menu and Open as administrator… (with Gnome/MATE).

The only tricky part of the VMWare tools install will be that it has trouble finding the kernel headers. Give it your best path /usr/src/linux-headers-3.xxx and let it go from there. The install will work.

After the VMWare tools are installed log out and restart the VM.

Development Environment Configuration
I add a minimal .bashrc to my home directory.


#!/bin/bash

export JAVA_HOME=/opt/java
export JDK_HOME=$JAVA_HOME
export JRE_HOME=$JAVA_HOME/jre
export M2_HOME=/opt/maven
export GOROOT=/usr/local/go
export PATH=$HOME/bin:$GOROOT/bin:$JAVA_HOME/bin:$M2_HOME/bin:$PATH
alias idea=$HOME/bin/idea.sh

Now, I need to install Java, Maven, Go, Idea, and Postgresql. I go to the respective websites to download the latest versions:

http://www.oracle.com/technetwork/java/javase/downloads/index.html
http://maven.apache.org/download.cgi
http://code.google.com/p/go/downloads/list
http://www.jetbrains.com/idea/download/index.html

As root (sudo bash) execute the following commands:

cd /opt
tar zxvf ~/Downloads/jdk-7u45-linux-x64.tar.gz
ln -s jdk1.7.0_45/ java
tar zxvf ~/Downloads/apache-maven-3.1.1-bin.tar.gz
ln -s apache-maven-3.1.1/ maven
cd /usr/local
tar zxvf ~/Downloads/go1.2.linux-amd64.tar.gz
apt-get install postgresql

End your sudo session and, as a non-privileged user, install Idea:

cd ~
mkdir bin
cd bin
tar zxvf ~/Downloads/ideaIU-13.0.1.tar.gz
ln -s idea-IU-133.331 idea
ln -s idea/bin/idea.sh idea.sh

Open a new non-privileged terminal window and test your configuration with:

java -version
mvn -version
go version
idea &

Create a Dev Postgresql Database
You’ll need to execute the following commands as root (or as user postgres if you want to drop the sudo). Feel free to rename the database.


# create a database user
sudo -u postgres createuser --no-superuser --no-createdb --nocreaterole devdbu
# create the schema owner
sudo -u postgres createuser --superuser --no-createdb --no-createrole devdb
# create the database
sudo -u postgres createdb -E UTF8 -O devdb devdb "Dev database"
# add the users to the database
sudo -u postgres psql -c "ALTER USER devdb WITH PASSWORD 'devdb'"
sudo -u postgres psql -c "ALTER USER devdbu WITH PASSWORD 'devdbu'"

To later add a schema:


psql -f schema.sql -d devdb devb

Comments are closed.