Um blog sobre nada

Um conjunto de inutilidades que podem vir a ser úteis

TensorFlow working on an Ubuntu virtual Machine

Posted by Diego em Agosto 5, 2016


This is a quick step-by-step on how to get TensorFlow working on an Ubuntu virtual Machine. The initial steps are very high level because it not hard to find tutorials or documentation that supports them.

1) Download and install Oracle Virtual Box from


2) Download an Ubuntu image from

3) Create a new VM (make sure to always run “as administrator” – you may get error otherwise):


4)Once the VM is up and running, install software to help development (Type CTRL + ALT + t -> shortcut to open a new terminal)



Guest Additions:

·   sudo apt-get install virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms


·         Download from:

·         Run: sudo dpkg -i /home/diego/Downloads/<DownloadedFile>

·         sudo apt-get install -f


·         sudo apt-get install htop

Anaconda (Jupyter notebooks – optional if you want to run the Udacity examples):


·         bash

·         Restart the VM or type: “. .bashrc” (two dots, without the quotes) on your home directory to update the PATH

·         Type jupyter notebook to start it


If not Installed Anaconda (probably using /usr/bin/python):


·         Run: sudo apt-get install python-pip python-dev

·         # For Ubuntu/Linux 64-bit, CPU only, Python 2.7

·         $ export TF_BINARY_URL=

·         # Python 2:  $ sudo pip install –upgrade $TF_BINARY_URL


If Installed Anaconda (probably using /home/<user>/anaconda/….)::

·         # Python 2.7:  conda create -n tensorflow python=2.7

·         conda install -c conda-forge tensorflow







Mounting a network driver:


* Mount:

Go to the settings on your VM and add add folder:



On Unix run:

sudo mount -t vboxsf TensorflowVMShared /home/diego/Documents/myMountedFolder



TensorflowVMShared is the Windows alias you created and

/home/diego/Documents/myMountedFolder is the folder on Unix



* See a list of mounts:

cat /proc/mounts


df –aTh


* Remove the mounts:

sudo umount -f /home/diego/Documents/myMountedFolder




$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

Download and unpack Pycharm (move it to the desired folder, like “opt”)

Run from the bin subdirectory


Creating a launcher icon:

Deixe uma Resposta

Preencha os seus detalhes abaixo ou clique num ícone para iniciar sessão:

Logótipo da

Está a comentar usando a sua conta Terminar Sessão /  Alterar )

Google photo

Está a comentar usando a sua conta Google Terminar Sessão /  Alterar )

Imagem do Twitter

Está a comentar usando a sua conta Twitter Terminar Sessão /  Alterar )

Facebook photo

Está a comentar usando a sua conta Facebook Terminar Sessão /  Alterar )

Connecting to %s

%d bloggers like this: