This is something I did for CASS, I found that Bitnami have a lot of useful applications that are available for download as .OVA1 files, however they all seem to be sized a bit too small to be useful, however that is one of the things we can fix:
- Working with the DokuWiki image, we nip over to the virtual machine download page and grab the OVA file.
- Find the downloaded and Double click to open it. Virtual Box should bring up a dialogue box with the Application Settings in it, at this point you can edit any of the fields by double clicking on them. Once you are happy click ‘import’.
- Without turning the virtual machine on, exit out of virtual box.
- In a cmd prompt
cd c:\Program Files\Oracle\VirtualBox
- To make the ‘.vmdk’ into a ‘.vdi’
vboxmanage clonehd "C:\Users\user\VirtualBox VMs\bitnami-dokuwiki\bitnami-dokuwiki-20170219e-4-r04-linux-debian-9-x86_64-disk1.vmd C:\Users\user\VirtualBox VMs\bitnami-dokuwiki\bitnami-dokuwiki-20170219e-4-r04-linux-debian-9-x86_64-disk1.vdi" --format vdi
- To resize the VDI file to almost 2TB
vBoxmanage modifyhd "C:\Users\user\VirtualBox VMs\bitnami-dokuwiki\bitnami-dokuwiki-20170219e-4-r04-linux-debian-9-x86_64-disk1.vdi" --resize 200000
200,000 is 200 Gigs, Don’t make your images too large as they don’t always give back hard drive space when you delete files inside the image (And you can easily make them larger).
- In Oracle Virtual box, you now need to change the drive that it uses from the ‘.vmdk’ to the ‘.vdi’ file
- Right click on the machine in the left hand pane >> ‘Settings’ >> ‘Storage’
- Under the ‘Storage Tree’ title you will see the currently attached drive on the SCSI controller. Select the drive, right click and select ‘Remove Attachment’
- Right Clicking on the controller, select ‘Add Hard Drive’ >> ‘Choose Existing disk’ >> navigate to where you have put the VDI file, and select it (It will not be moved, or copied, so chances are you want it in the same folder that the VMDK file was in).
- Resize the File System:
- I have a copy of the GNOME Partition Editor (GParted) Live CD as a VM on my machine, that I use to resize other machines.
- Right click on the GParted machine in the left hand pane >> ‘Settings’ >> ‘Storage’
- Right Clicking on the controller, select ‘Add Hard Drive’ >> ‘Choose Existing disk’ >> navigate to where you have put the VDI file, and select it (its OK to have it connected to two machines).
- Power up the GParted machine, and load X.
- At the top of the box, should be the attached Bitnami box >> right click >> resize to fill the available space
- Exit GParted and shut down the VM, and remove the additional drive
- Start the Bitnami VM by double clicking on it 🙂
- Login details for the webapp are displayed in the terminal console window
- On first login (bitnami:bitnami) you will be asked to change the shell password (ctrl+x will dismiss, using the ”passwd” command will let you change the password).
Things you should do afterwards
Update all the things!
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
Enable SSH on Bitnami
By default SSH is not enabled on Bitnami boxen, however its easy to set up from the command line 🙂
Debian based boxes
sudo rm -f /etc/ssh/sshd_not_to_be_run sudo systemctl enable ssh sudo systemctl start ssh
Ubuntu based boxes
sudo mv /etc/init/ssh.conf.back /etc/init/ssh.conf sudo start ssh
Remove the bitnami banner from the webapp
In a terminal
sudo /opt/bitnami/apps/APPNAME/bnconfig --disable_banner 1
The above step will only remove the corner banner. The Bitnami Info page will still be available by visiting http://ipaddress/bitnami/index.html
Install nano
I like nano as a text editor, it doesn’t need me to remember dozens of random commands to exit it 🙂
sudo apt-get install nano
Change system Timezone
sudo echo "Europe/London" > /etc/timezone sudo dpkg-reconfigure -f noninteractive tzdata
Change php.ini time zone;
sudo nano /opt/bitnami/php/etc/php.ini
Change “date.timezone” to “Europe/London” (or wherever you are).
Reboot your machine
sudo reboot