Drupal Multihost on VirtualBox – Part 1

The Misadventures of Dabbling into Drupal and VirtualBox

Part 1: Following the Directions from Katy’s Site

I looked at the Part 1 directions and installed:

  1. VirualBox
    1. Download and install VirtualBox from https://www.virtualbox.org/wiki/Downloads
      Start VirtualBox.
  2. Vagrant
    1. Download and install the latest version of Vagrant from http://downloads.vagrantup.com. For this tutorial, we will use version 1.0.6.
      Windows users, download Vagrant.msi
    2. You may need to add “C:/vagrant/vagrant/bin” to your Path
  3. Create a directory /workflow under $c:/Users/[your user]
  4. Git
    1. Download Git for Windows here:
    2. See tutorial on How to Install Git in Windows 7 PC.
  5. Download Vagrant Chef script with Git, Open Git-Bash and type the following commands:
    1. $ cd C:/Users/User/workflow
    2. $ git clone https://github.com/eaton/vagrant-chef-dlamp
  6.  In order for this chef script to work on Wndows 7, you need to make the following edits in a file called VagrantfileLine 24  should be: config.vm.forward_port(80,8888)Line 29 should be: config.vm.share_folder(“v-root”, “/vagrant”, “.” :nfs => FALSE)
  7. Open your text editor in Windows and edit  $c:/Windows/System32/etc/hosts file dev-site.vm
  8. Use a Windows command prompt to install the Linux+Apache+PHP in the VirtualBox
    1. C:/Users/User>
    2. C:/Users/User> cd workflow
    3. C:/Users/User> cd vagrant-chef-dlamp
    4. C:/Users/User/workflow/vagrant-chef-dlamp> vagrant destroy
    5. C:/Users/User/workflow/vagrant-chef-dlamp > vagrant up
    6. The ‘vagrant up’ command will take time…
    7. Create a Shared folder  – shared between Windows and Vagrant DLAMP server In Windows cmd prompt:
      C:/Users/User/workflow/vagrant-chef-dlamp> mkdir public
  9. Putty (What you use to work on your virtual system)
    1. Install Putty – http://www.putty.org
    2. Open Putty
      1. Setup the Hostname as:
      2. Port: 2222
    3. You get a nasty security message, Click Yes
    4. Login: vagrant
    5. Password: vagrant
  10. Go to http://drushmake.me and create your drush file.  Download and Save it in the C:/Users/[youruser]/workflow/vagrant-chef-dlamp/public as starter.make
  11. There are some errors in the drush make file that need to be corrected:
    1. This line projects[drupal][version] = 7 should be projects[drupal][version] = 7.19 or
    2. projects[] = drupal
  12. Back in Putty session:
    1. $ drush make starter.make
    2. $ drush site-install – -db-url=mysql://root:root@localhost/dbname – Note** – the last part of this command created a dbname database for me
  13. Misc Drush Commands:
    1. Drush dl modulename1 for download
    2. Drush en modulename1 for enable
    3. Drush pm-disable modulename1 for disable
  14. Look at your site – http://dev-site.vm/

Problems encountered:

Vagrant up:  I had some odd messages that I needed a better guest additions and spent a lot of wasted time, thinking that is why the drush make and drush site-install didn’t work.

I had problems that the drush acted like it downloaded stuff, but didn’t really do it. Then when I went to do the drush site-install, it wouldn’t find Drupal.   I ended up going back to drushmake.me and regenerating a make file and downloading it. (Well, I actually did a Select-All and Copy-and-paste into the starter.make file)

Putty:  directory not found problem – I ended up making sure to do a cd / to go back to the root of the Linux and then cd dir1/dir2 (or whatever)

After the VirtualBox crash:  I had my laptop down for hibernate and it shut itself down and forced Virtual Box down.  (hadn’t been saved). When I restarted it, then it had problems finding the /public directory and I started again to reload the box.

Next Posts:  How I copied from Live Site down to VirtualBox, How I converted to a Multisite on the VirtualBox


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s