In this second part we're continue some setup and go through a test magento install. You can find the first part here if you missed it.
We now need to grant our host machine access to connect to MySQL on our vm. Here you'll use the MySQL root password you setup previously. Note: if you used a different IP address adjust the commands accordingly.
mysql -u root -p
Once connected run the following SQL (fee free to change the password):
GRANT ALL PRIVILEGES ON *.* TO root@'192.168.56.1' IDENTIFIED BY 'magedev'; FLUSH PRIVILEGES; exit
su root nano /etc/mysql/my.cnf
Find and comment out the bind-address setting:
... skip-external-locking # # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. #bind-address = 127.0.0.1 ...
I'll be using SequelPro on my system, but the settings should be similar for MySQL Workbench.
Sharing folders with guest system.
We'll now setup a local directory that will be accessed on the virtual machine. This will allow applications on the host machine to work on files locally and changes will be immediately seen by the guest vm. There will be no need to transfer files or mount the remote host via [s]ftp or sabma.
I personally like to keep all project files inside of ~/Documents/Projects. I will share this parent directory so that any new project I add will be accessible by the vm. From the Devices menu select “Shared Folders”, click on the Add Shared folder icon.
On the virtual machine run the following:
su root mkdir /mnt/Projects chown magedev:magedev /mnt/Projects/
We'll now configure our shared folder to mount on start up:
Add the following to the bottom of the file:
Projects /mnt/Projects vboxsf defaults,ttl=5,uid=1000,gid=1000 0 0
mount -a ls /mnt/Projects/
You should see any files you have on your local Projects folder. If you started with a new directory, try adding some files to make sure everything is working properly. Note, the uid and gui are of our magedev user, chances are that your system should have the same values.
We'll start off by downloading the source off of Magento's SVN. Feel free to download the zip/tar and extract the source yourself from here. From the host machine:
svn export http://svn.magentocommerce.com/source/branches/1.6 ~/Documents/Projects/magedev
Lets add a local host for our project, add
to your /etc/hosts file.
Now we must link the ~/Documents/Projects/magedev directory to our magedev user's public_html directory. On the virtual machine run:
ln -s /mnt/Projects/magedev /home/magedev/public_html/magedev
Now navigate to http://magedev.vm/, you should be greeted by the Magento Installation Wizard. As these next
If you've been following along the information for MySQL should be:
Web Access Options:
Base URL: http://magedev.vm/
Admin Path: admin
Enable Charts: Checked
Skip Base URL Validation…: Checked
Use Web Server (Apache) Rewrites: Checked
Use Secure URLs (SSL): Unchecked
Session can be set to “File System” (not shown in screen shot).
Once you hit continue Magento will proceed to install, once completed you can create the initial admin account:
If everything worked out well for you then you should see the same results. If you ran into any issues feel free to leave a comment.
One Small Kink
Due to the use of VirtualDocumentRoot directive in Apache mod_rewrite tends to break/get confused and magento's .htaccess needs some tweaking. Modify magento's .htaccess file:
Locate the “#RewriteBase /magento” line and replace it with: “RewriteBase /“.