Robert Basic's blog

Posts tagged 'virtualbox'

Issues with Vagrant after upgrading to Fedora 25

by Robert Basic on December 24, 2016.

Fedora 25 was released over a month ago, so I decided it was time to upgrade from 24.

Using the dnf plugin system-upgrade the entire process went smooth. The Fedora Magazine, as always, has a nice post on how to upgrade.

So far I ran into only a couple of minor issues with Vagrant.

The first one, which isn’t really a problem, is that Vagrant got downgroaded to version 1.8.x from 1.9.1 which I had installed in Fedora 24. The fix for that is easy, just install the new version again:

robert@odin ~$ sudo dnf install ~/Downloads/vagrant_1.9.1_x86_64.rpm

The second issue was that, well, vagrant didn’t really want to work. When trying to run vagrant up it would spit out the usual kernel module is not loaded error.

The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:

VirtualBox is complaining that the kernel module is not loaded. Please
run `VBoxManage --version` or open the VirtualBox GUI to see the error
message which should contain instructions on how to fix this error.

Running VBoxManage --version provided a helpful message, for once:

robert@odin ~$ VBoxManage --version
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (4.8.15-300.fc25.x86_64) or it failed to
         load. Please try load the kernel module by executing as root

           dnf install akmod-VirtualBox kernel-devel-4.8.15-300.fc25.x86_64
           akmods --kernels 4.8.15-300.fc25.x86_64 && systemctl restart systemd-modules-load.service

         You will not be able to start VMs until this problem is fixed.
5.1.10r112026

Looking at the list of installed packages with dnf list installed I saw that both the akmod-VirtualBox and the kernel-devel packages are installed.

Running the next command fixed the issue:

robert@odin ~$ akmods --kernels 4.8.15-300.fc25.x86_64 && systemctl restart systemd-modules-load.service
Checking kmods exist for 4.8.15-300.fc25.x86_64            [  OK  ]

VBoxManage shows no warnings any more:

robert@odin ~$ VBoxManage --version
5.1.10r112026

and Vagrant works just fine again.

Happy hackin’!

Tags: akmod, fedora, vagrant, vboxmanage, virtualbox.
Categories: Development, Software.

LAMP and SVN on Ubuntu 8.10

by Robert Basic on November 24, 2008.
Heads-up! You're reading an old post and the information in it is quite probably outdated.

This post is a rewrite of one of my older posts, Ubuntu as a dev machine, but this time I’ll explain also how to setup a basic SVN besides the LAMP.

Ubuntu 8.10 was released bout a month ago and today I wasn’t in the mood of doing any coding so I decided to try out the new Ubuntu. Once again, I’m installing it under VirtualBox (VB), cause it seems that they still haven’t fixed the bug related to the rtl8187 chipset. Oh well…

Be sure to use VB v2.x.x. (v2.0.6. is the latest now), cause it’s recognizing the correct screen resolution, not like VB v.1.6.4, whit which I had to configure manually the xorg.conf file…

Setting up LAMP

Here are the commands:

sudo apt-get install apache2
sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
sudo apt-get install mysql-server
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
sudo /etc/init.d/apache2 restart
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

If mod_rewrite doesn’t work, do the following:

sudo gvim /etc/apache2/sites-available/default

And change AllowOverride None to AllowOverride All.

Setting up SVN

I’m not gonna explain how SVN works or the terms, this is just how to set it up. If you are not familiar with versioning and Subversion, read this book: Version Control with Subversion. It’s free, available for download and contains probably everything you need to know about SVN. Be sure to learn the commands like commit, import, export, checkout, add, info, etc…

There are 2 ways for setting up SVN: as an Apache module or to use svnserve which is designed for SVN. As I already have Apache installed, the best solution is to use Apache for SVN. It’s using a module called mod_dav_svn.

The setup presented here is very basic, it has no authentication and probably is insecure, but it’s good for my needs on localhost.

The commands:

sudo apt-get install subversion
sudo a2enmod dav
sudo /etc/init.d/apache2 restart
sudo apt-get install libapache2-svn
sudo /etc/init.d/apache2 restart

Now we have all packages installed, only the configuration left.

First, I create a folder called svn under the var folder:

sudo mkdir /var/svn

Now I need to create a folder under the svn folder where all my repositories will be:

sudo svnadmin create /var/svn/repos

We use the svnadmin create command to create the repository; mkdir is not good for this.

Next, open up the httpd.conf file and add the following lines to it:

<Location /repos>
    DAV svn
    SVNPath /var/svn/repos
</Location>

I’ve seen people creating a new user and group for SVN. I think (I haven’t looked into it detailed) that’s for the authentication stuff. I did a much simpler thing: I added the ownership over /var/svn to www-data (Apache user):

sudo chown -R www-data /var/svn

This is probably a big security hole, but again: I use it only on localhost so I can live with that.

We are now ready to import a project into SVN, i.e. to add a project to the repository:

svn import -m "First import to SVN" /import/from/here/project file:///var/svn/repos/project/trunk

To start working on that project we need to checkout it:

svn checkout http://localhost/repos/project/trunk /var/www/project

Now the “project” is under SVN which should ease the development process. Since I’m using SVN I have no more backups of projects all over the place; if something goes wrong I know it’s under SVN and I can revert to any older working version of my project.

Cheers!

Tags: apache, lamp, setup, subversion, svn, ubuntu, virtualbox.
Categories: Development, Programming, Software.

Ubuntu as a dev machine

by Robert Basic on October 15, 2008.
Heads-up! You're reading an old post and the information in it is quite probably outdated.

This post is more of a note to myself, ‘cause I keep forgetting all these Linux commands, and spend hours setting up stuff right…

I’m installing Ubuntu 8.04 on VirtualBox, with windows xp as the host machine. I must do it this way, because my wireless card is having some problems with Linux, something with the drivers. The possible solution includes kernel compiling — thanks, but no thanks.

Anyway… The installation itself is no trouble, so I’ll skip that. I always keep the apt-cache from previous installations, sparing hours of updating the system… On the host I have a folder that I share between the host OS and the client OS and first I need to reach that folder, to get from it the apt-cache.

First, need to install the Guest Additions. In Virtualbox go to Devices —> Install Guest Additions. In the console run:

sudo /media/cdrom/VBoxLinuxAdditions.run

After it’s finished, we need to mount the shared folder:

sudo mount -t vboxsf name_of_the_sharing_folder /path/to/mount_point

Now, for me, this command shows some error. Here’s what I have to do:

sudo modprobe vboxfs
sudo mount -t vboxsf name_of_the_sharing_folder /path/to/mount_point

Something with some modules not being loaded into the kernel, not bothered with it really… Now I can copy the apt-cache to where it needs to be:

sudo cp -r /path/to/mount_point/apt-cache /var/cache/apt/archives

Now do the system update. If the system update includes a kernel update, you’ll have to install Guest Additions once more…

Next installing the LAMP:

sudo apt-get install apache2
sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
sudo apt-get install mysql-server
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
sudo /etc/init.d/apache2 restart
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

That should do it. But hey! mod_rewrite still doesn’t work!

sudo gvim /etc/apache2/sites-available/default

And change AllowOverride None to AllowOverride All.

There. I have a basic LAMP on Ubuntu under VirtualBox. I made a few snapshots of the VirtualBox image, in case I trash it (which probably will happen soon), so I don’t need to reinstall over again.

Now, I’m of to setup SVN…

Tags: apache, lamp, linux, mysql, php, setup, ubuntu, virtualbox.
Categories: Development, Software.