• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Get a free development environment for XenForo up and running in minutes

Kier

XenForo Developer
Staff member
#1
I thought it would be good to document how you can configure and run a near-zero-maintenance, pre-packaged virtual machine to use as your development server for XenForo, without having to install a load of low-level stuff on your computer.

So I did:

https://xenforo.com/xf2-docs/dev/scotchbox/

Edit: Updated the docs on the site to handle the problems people have found in this thread. It should work nicely now.
 
Last edited:

DragonByte Tech

Well-known member
#3
Looks interesting, I wonder how performance is like compared to installing them manually (either via Homebrew for Mac or XAMPP for Windows). Gonna install and give it a wee test :)


Fillip
 

Kier

XenForo Developer
Staff member
#4
Looks interesting, I wonder how performance is like compared to installing them manually (either via Homebrew for Mac or XAMPP for Windows). Gonna install and give it a wee test :)


Fillip
My main objection to homebrew etc. is that it tends to spew rubbish all over the OS. With a Vagrant box, everything is in one place, and in the event that it all goes wrong, delete the box (vagrant destroy) and create a new one (vagrant up) - time required: about 10 seconds. Brilliant.
 

Aayush

Well-known member
#5
My main objection to homebrew etc. is that it tends to spew rubbish all over the OS. With a Vagrant box, everything is in one place, and in the event that it all goes wrong, delete the box (vagrant destroy) and create a new one (vagrant up) - time required: about 10 seconds. Brilliant.
Can't agree more. The build and cleanup process are fast and simple.
 

DragonByte Tech

Well-known member
#7
My main objection to homebrew etc. is that it tends to spew rubbish all over the OS. With a Vagrant box, everything is in one place, and in the event that it all goes wrong, delete the box (vagrant destroy) and create a new one (vagrant up) - time required: about 10 seconds. Brilliant.
The main issues I have with manual approaches:
1) Services are always running, even if you aren't working
2) Moving between computers is a pain
3) You had the audacity to install a beta version of macOS, guess that means no updates for you for a while :p

On the other hand:
1) Native performance so you don't have to deal with virtualisation
2) VirtualBox installs a bunch of rubbish on your computer too, I had a hell of a time cleaning up all of the leftovers when I tried it on my Mac
3) Performance can be a problem
4) Harder to update your software (testing PHP 7.2, for example)


Fillip
 

Kier

XenForo Developer
Staff member
#8
I personally run a PHP 7 virtual machine and a PHP 5 virtual machine. They both share the same htdocs folder, located on the host machine, and they both connect to MySQL installed natively on the host (via 192.168.33.1).

Performance is great for the most part, and because MySQL is running natively, and the files are available on the host too, i can run XF cli commands right on the host machine.
 

DragonByte Tech

Well-known member
#9
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "e23f837b-6192-42aa-8d8a-47214a1af669", "--type", "headless"]

Stderr: VBoxManage.exe: error: VT-x is disabled in the BIOS for all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
Sadniss Everteem :(

Time to go faff around in the BIOS :p


Fillip
 

DragonByte Tech

Well-known member
#10
Trying to install XF2 on this but receiving the following:
The following errors occurred while verifying that your server can run XenForo:
  • The required PHP extensions for XML handling (DOM and SimpleXML) could not be found. Please ask your host to install these extensions.
Please correct these errors and try again.
Seems like Scotch isn't the perfect XF2 VM out of the box :p


Fillip
 

Kier

XenForo Developer
Staff member
#11
Kind of odd they want you to pay to use PHP 7 and MySQL 5.7 though
I think the Pro option is more about multi-user box provisioning and other advanced Vagrant tools - not really the kind of stuff I’m using, but I paid for Pro anyway as Scotch Box has saved me so much time, I thought it was important to support the project.
 

DragonByte Tech

Well-known member
#13
Odd, I’ve never encountered that myself
Apparently it's implemented in Pro according to https://github.com/scotch-io/scotch-box/issues/311 which would explain why you're not getting it.

I'm finding that unless I stick to locally installed MySQL I can't use this, my SQL client doesn't support SSH tunnelling unless I pay for it (SQLyog Community Edition). If I use local MySQL that takes away some of the portability, so that diminishes the value for me unfortunately :(

I'll report back whether the fixes in that thread works for me.


Fillip
 

Kier

XenForo Developer
Staff member
#15
I'm finding that unless I stick to locally installed MySQL I can't use this, my SQL client doesn't support SSH tunnelling unless I pay for it (SQLyog Community Edition). If I use local MySQL that takes away some of the portability, so that diminishes the value for me unfortunately :(
Have you tried SequelPro?
 

DragonByte Tech

Well-known member
#16
Have you tried SequelPro?
Not available on Windows.

Also, I think I may have discovered a bug in the installer. When you have an existing config.php file, it says XF2 is already installed even though the only table in there is the "xf_session_install" table.

I didn't want to risk it since I used the same DB name as I did my non-VM MySQL install.


Fillip
 

Kier

XenForo Developer
Staff member
#18
Not available on Windows.

Also, I think I may have discovered a bug in the installer. When you have an existing config.php file, it says XF2 is already installed even though the only table in there is the "xf_session_install" table.

I didn't want to risk it since I used the same DB name as I did my non-VM MySQL install.


Fillip
Could you create a tunnel with PuTTY and connect your normal client through that?
 

DragonByte Tech

Well-known member
#20
Could you create a tunnel with PuTTY and connect your normal client through that?
I've never tried creating a tunnel with PuTTY before, I'll have to do some research :)

Right now I just need a quick XF2 install to test a clean install of one of our XF2 mods, I'll report back once I've tried tunnels.


Fillip