TurnKey Linux Virtual Appliance Library

Understanding Magento Appliance from TurnKeyLinux.org and VirtualBox.

i am quite a newbie to web dev but I manage a magneto website and have come to the point where i have to hire devs for certain things plus just upgrade my own workflow. thought I would install XAMPP and TortoiseSVN and be good to go...just tweak locally and upload changes to my server when they are done. then I came across a couple blogs that talked about workflows like Magento Appliance from TurnKeyLinux.org. some other are with Ubuntu and other variations making the whole thing a bit confusing as to the best way to go. my only experience with virtual machines is running Parallels Desktop 6 for Mac (but not for web dev). My current machine is Windows 7 and I am trying to figure out what a good option is for magento web dev on this machine. is Magento Appliance from TurnKeyLinux.org and VirtualBox doable for a newbie or is it super complex? does it come with TortoiseSVN or ?? assuming it is all set up, how do you use SVN?

Jeremy's picture

I have no idea about TortoiseSVN

As I've never used it. And for that matter I haven't used the Magento appliance either. But I can tell you that setting it up should be as easy as installing VirtualBox, downloading the appliance (the VM image should be almost too easy to get started although personally I prefer using the ISO) and installing. There is a tutorial in the docs here that should get you started. It's for an old version of VirtualBox so may be slightly different but the theory should be the same.

As for working with your appliance, TKL appliances all have a number of tools preinstalled that are quite useful, the connections will be listed on the confconsole screen (blue screen that shows in the VM window once install is complete). You access most of these services via your web browser. Personally I also like to use an SFTP client (Filezilla is my favourite but there are plenty of others). When working from Windows I also find PuTTY useful (SSH client).

Jump in and get your hands dirty and see how you go. If you have any further questions don't hesitate to ask, although I probably won't be very useful with Magento specific stuff.

well i get as far as

well i get as far as installing it and now I am supposedly logged into "magento"

 

and I am at root@magneto ~#

 

what now???


Jeremy's picture

You have logged into the underlaying Linux OS

So I am assuming that will be of little use to you at this point. TKL appliances are basically headless servers and as such are designed so all admin can be done remotely (thus they include no fancy desktop environment, only commandline). To access/use/play with Magento you will need to use your web browser. On the confconsole screen (blue screen with plain text) it should tell you the IP to use. Alternatively you can set a static IP. If you have shut confconsole (sounds like you have) then you can start it again by typing confconsole at the commandline.

If you have any problems accessing it, double check that you have your virtual networking set to either 'host only' or 'bridged' (NAT won't work). If you wish to access your appliance from a machine on your LAN other than the VBox host machine, you will need to use 'bridged'.

As you will see from the confconsole, there are other ways to administer your appliance such as Webmin (Linux Admin WebUI), Webshell (Web based terminal/commandline access) and some have phpMyAdmin (WebUI for administration of MySQL daabases - although I'm not sure if Magento includes this one?) But as I said before you can also use Windows client software (such as Filezilla for filesystem GUI, or PuTTY for SSH/commandline access).

OK I am at the confconsole

OK I am at the confconsole when I boot and I see the IPs but dont know what to do from there. its just giving the option of "advanced menu" and no mouse control

 

edit: ok i think i see my problem now. when I did my intial setting it askes what my domain was gong to be and I put in the worong info so when i type i.e. 192.168...blah blah into the brower it goes to that wrong domain . how can i chage that domain it goes to and what should it be?


Jeremy's picture

You could try the domain set script

Adrian Moya originally developed this appliance and in his initial patch, he included a bash script to set the domain. I'm not sure whether the TKL devs kept that script or included that functionaily somewhere/somehow else.

You could just try running it like this first:

setupdomain DOMAINNAME

For example:

setupdomain www.example.com

If that doesn't work then I can only assume that the script isn't included. Adrian's original script is documented in his patch documentation here. Scroll down to the section titled "setupdomain script". If you copy/paste that into a text document (use nano inside your appliance or Notepad++ from Windows - don't use Win Notepad as it mangles Linux files), make it executable and run it in your appliance, it should work.

If you have further probs I'll try to help out but as I said I'm not familiar with Magento (although usually fairly handy with basic/generic Linux stuff and a dab hand with google!) As TKL appliances are usually a default install of the particular app, often the best place for specfic info re support are the app's documentation/wiki/forums/mailing lists/etc eg in this case Magento CE support area is probably a good starting point. Often google can provide lots of info too. If you do come across any problems (or even better still solutions) it'd be great if you can post them here. The theory being that if you encounter it, you can be sure that someone else will too. That is one of the best ways you can 'give back' to free open source software IMO.

setup domain

OK so i am creating a new machine from scratch

I am at the screen "Enter the domain to serve magento"

what do I put here?


Jeremy's picture

So you have done a clean install of TKL Magento?

Assuming you are using this as a devlopment server to be run as a VM and accessed via the host machine, then choose a domain and add an entry to the hosts file of the host machine pointing to the VM. Then everything should work as expected.

As for the other question (where to input commands) that's what PuTTY is for, or you can quit out of confconsole or use Webshell (https://xxx.xxx.xxx.xxx:12320) via your web browser.

so if I

"Assuming you are using this as a devlopment server to be run as a VM and accessed via the host machine"

yes I am

so if I add myrandomfakedomain.com to the host file it will work or it has to be a certain format or a real domain??


Jeremy's picture

That's pretty much it.

Just add the domain name and the IP address of your VM (seperated by a space or tab from memory) to your hosts file and you should be good to go.

again, sorry to be so

again, sorry to be so newbieish but do you mean

http://192.168.1.104  or  ??


Jeremy's picture

No worries :)

It's been a while but from memory, there is often an example entry in the hosts file of either localhost, or sometimes something random commented out. Try something like this:

myrandomfakedoamin.com   192.168.1.104

ok the format

ok the format is

192.168.1.104 myrandomfakedoamin.com   

i will add it to hosts file and just create a new machine and try to put

192.168.1.104 mage.com    

for "domain to serve"

we'll see if it works


Jeremy's picture

Just to clarify

So we're on the same page here. I am talking about the hosts file in your host OS (ie Win 7). It should be C:\Windows\System32\drivers\etc\hosts or similar. I have also read that the only way to edit it in Win 7 (and Vista) is to open Notepad as Admin (right click - open as Admin) then browse to the file (even if your account has Admin privileges). Otherwise you will get an error when you go to save.

Let us know how you go. And any more questions, don't hesitate to ask.

  yes i have worked with

 

 i have worked with host file before and understand it but no go on this


Alon Swartz's picture

When you specify the domain...

When you specify the domain to serve, do not include the IP address. The format should be similar to shop.example.com. You could then update your hosts file to point to the magento install.

Regarding changing the domain after first boot configuration, you could try manually executing the inithook again (I don't recall if I tried that during testing, but I'm pretty sure it should work).

/usr/lib/inithooks/bin/magento.py
Jeremy's picture

Tested and working

Well actually I didn't test that specifically, but I tested the fileserver.py on the fileserver appliance and it worked like a charm. :)

Thanks Alon

[update] I have now also tested mysqlconf.py on the LAMP appliance and this works as well.

THANK YOU!!- Fixed my issue with Magento VZ on PVE2

I was having issues getting to magento from the VZ appliance on my PVE2 box. I did not remember setting the domain to shop.exmaple.com. 

using the console I ran:

 

/usr/lib/inithooks/bin/magento.py

and used the whole dyndns domain including port and I can get to magento from the outside perfectly. 

 

Thanks again

"When you specify the domain

"When you specify the domain to serve, do not include the IP address. The format should be similar to shop.example.com."

OK first off, I am using a fake domain. Should I be? Or must it be real? Clearly I dont own mage.com. Should i create a subdomain of my real website? Aside from those questions, i did only input mage.com into "domain to serve" and not the IP.

"You could then update your hosts file to point to the magento install."

My host file is exactly like this:

#    Copyright © 1993-1999 Microsoft Corp.
#    
#    This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#    
127.0.0.1    localhost
10.0.2.15 mage.com

I didnt think this would constitute "pointing" but maybe it does. Anyhow, what is the exactly format to be used?


Alon Swartz's picture

First things first...

First things first - if you ping mage.com does 10.0.2.15 reply? If so you are good to go on that issue. 

If the above works, what happens when you browse to mage.com? What is displayed?

I'm not sure if magento supports top-level domains, you might need to specify a subdomain, for example: test.mage.com

BTW, if your appliance is accessible from the internet, you could use the free tklapp.com domain, in which case you wouldn't need to mess with your hosts file. It would also make it very easy to later migrate the server using the exact same fqdn to the cloud using tklbam.

"tklapp.com" sounds

1. I deleted all machines and installed a new one. Now everytime I launch it, it runs the install process again?? (partition, install, grub bootloader, sercuty updates-re enter passwords...everything!!)

So i just ran through that process again and then I am at this screen: http://tinypic.com/r/30ubfys/7

----

2. Cant log into it: http://i52.tinypic.com/2pq6frc.jpg

3.  I was not able to

ping 10.0.2.15 mage.com

(the IP I mistakeinly got from VM)

So I changed to 127.0.0.1 mage.com and I am able to ping mage.com

I log in on firefox and it is blank: http://i55.tinypic.com/rucp6d.jpg

(maybe #2 and #3 has somtehing to do with # 1?)

I can see files here but where is magneto installed?: http://i52.tinypic.com/1hfs4o.jpg

Is this thing installed or??????


Jeremy's picture

Not completely following

Firstly I hope you don't mind but I tidied your post up and removed extra line breaks so it's a little more readable.

Now that you have pointed mage.com in your hosts file to 127.0.0.1 (that's the terminology) it's no surprise it responds to ping, but doesn't display anything in firefox. That's your host machine (127.0.0.1 is commonly refered to as a loopback - it points back to the localhost ie your host PC).

So get your VM running. Perhaps start over with a clean install (3rd time lucky!?) or try running the script suggested by Alon. During install give it a FQDN (Fully Qualified Domain Name ie somesite.somedomain.com). Assuming you only want local access (as it seems you do) and you are happy to edit your hosts file, then this domain does not need to be real, or owned by you.

Once it is installed and running, take note of the appliance IP. Check connectiviy by pinging that IP from your host machine, perhaps even check that you can contact it via your web browser (using the IP - don't worry about logging in or anything, just check that it's your Magento appliance). Now still in confconsole, give your appliance a static IP (I suggest just using the one that DHCP gave it, ie the one initially displayed in confconsole, the one you have already checked is working). Double check that you can still ping it (if you could before you should still be able to now).

Now edit your hosts file and make the IP you have just set point to the domain you gave your appliance during install. It should work with just the top level domain (ie somedomain.com) although personally I'd be inclined to put the FQDN ie:

#    Copyright © 1993-1999 Microsoft Corp.
#    
#    This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#    
127.0.0.1    localhost
10.0.2.15    somesite.somedomain.com

Where 10.0.2.15 is your appliance's IP.

Hopefully, that should be it and you can get on with playing with Magento. Fingers crossed :)

OK I will try to start over.

OK I will try to start over. but to be clear,

 

I can see files here but where is magneto installed?: http://i52.tinypic.com/1hfs4o.jpg

is this where magneto is installed ?

 

----

when you say appliance's IP you mean this?

http://i51.tinypic.com/2qlbcxu.jpg

like it shows in the image, it says its running now and I cant ping it from the appliance's IP

also, is that screen pretty much it for the UI (or opertaions right insdie that VM window) and in normal operations I would just get to that screen and then run putty or a broswer?


Jeremy's picture

newimage.vdi is your Magento appliance's virtual HDD

VDI stands for Virtual Disk Image and it is in effect your VMs HDD. So that is where Magento is installed.

The second screenshot you gave is the Configuration Console (confconsole) and yes the IP there (10.0.2.15) is the one you'll use (in this instance - it's quite likely that will be different with a new VM). If you can't ping its IP from your host machine (while it's running - ie ping 10.0.2.15) then there is some other issue at play.

Double check you have set VirtualBox networking to either 'bridged' (which is probably the easiest although also the least secure way to go) or 'host only' (which will only allow you to connect from your host PC, no internet in or out). If you choose 'host only' you can add another virtual NIC (set to 'NAT') to give you internet access (for updates, backup etc) but perhaps don't worry about that just yet.

Once the appliance is installed and running and you have configured your static IP then you will no longer need to refer to that VirtualBox window (although you can use it for commandline stuff if you'd like). Personally I prefer to just use PuTTY and Filezilla (good for GUI filesystem management). Also everything can be done via your web browser. All the required info is displayed in the confconsole. Webshell is a web based CLI, Webmin is a Linux admin WebUI and phpMyAdmin is a MySQL database admin WebUI. Once you have the basics set up you only rarely need to use them. Most of your work will occur through the main web site.

I got ya, that all makes

I got ya, that all makes sense. I really dont think i need to reinstall. just like the images show, it IS installed and it IS running.

Only other question in the loaction is can you browse the files of magento in windows explorer?

other than that, like you said, "If you can't ping its IP from your host machine (while it's running - ie ping 10.0.2.15) then there is some other issue at play."

based on your feedback my host file now has

10.0.2.15 mage.mage.com

Unfortunatly I am a bit stuck at this point on what should be a really easy networking thing. I have done more of this kind of thing on a Mac and not so much on Windows. If anyone knows Windows 7 and has any tips feel free to let me know.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\staff>ping 10.0.2.15

Pinging 10.0.2.15 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 10.0.2.15:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

C:\Users\staff>ping 10.0.2.15

Pinging 10.0.2.15 with 32 bytes of data:
Request timed out.
Reply from 98.xxx.xxx.1: Destination net unreachable.
Request timed out.
Request timed out.

Ping statistics for 10.0.2.15:
    Packets: Sent = 4, Received = 1, Lost = 3 (75% loss),

C:\Users\staff>


Jeremy's picture

That looks a little strange...

Particularly: Reply from 98.xxx.xxx.1: Destination net unreachable.

I'm not sure why 98.xxx.xxx.1 is even trying to respond! Perhaps try a traceroute (ie tracert 10.0.2.15) to see where it is going. You could also try pinging your host machine from inside your VM (quit out of confconsole to get to the Linux CLI). The ping command works very similarly in Linux, only thing is that it will ping forever until you stop it (not just 4 times like WIndows) <Ctrl><C> to quit out of it.

Like I said above check the VM networking (accessed via the VBox GUI - config for your VM) - probably best to go with 'bridged' networking for now. You will need to shut down your VM to change it (otherwise the option will be grayed out). If it's currently set to 'NAT' then that's your issue - easy fixed! If your VM is still set to DHCP then it should auto refresh on boot. Otherwise try refreshing the IP (via DHCP). Easiest way to do that is to set it to static (any IP - probably best to set it to something odd so you'll know when DHCP has picked up a good IP), save, then set it back to DHCP - all done via the confconsole. Test you can ping it from your host and if so, set that same IP as static (via confconsole).

If it's already set to 'bridged' but still not working then you'll need to try to work out what the issue is - it shouldn't be anything to do with TKL, it'll be something with VBox or Windows. You could try to refresh the DHCP IP as I said in the above paragraph, but I doubt that'll do it.

Once you have a valid working IP I strongly suggest you set it to static.

To access your VM's filesystem I suggest you try Filezilla (SFTP). It is a dual pane Windows Commander style GUI for filesystem access (via SFTP). Webmin also has a (Java based) file manager.

There are other ways you can go, but as SFTP is setup and running by default it requires very little config to get going. Other SFTP options include WinSCP or there is an alpha SFTP Windows Explorer plugin which I found in my travels some time ago but haven't tested (sorry forget the name of it). You could also use Samba (Windows filesharing for Linux - you'll need to install it in your appliance) or Virtual Box shared folders (you'll need to install VBox tools - a little tricky). Both of these last options require additional config and as such I think you'd be better off leaving them alone at least for now (wait until you have this bit running and working as expected then explore other options if you're keen).

Is it OK to post these kinds

Is it OK to post these kinds of results publically? ??

I paste in the cmd result. 

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\staff>tracert 10.0.2.15

Tracing route to mage.mage.com [10.0.2.15]
over a maximum of 30 hops:

  1    <1 ms    <1 ms     2 ms  192.168.1.1
  2  adsl-98-xxx-xxx-1.bna.myisp.net [98.xxx.xxx.1]  reports: Destination net
unreachable.

Trace complete.

C:\Users\staff>ping 10.0.2.15

Pinging 10.0.2.15 with 32 bytes of data:
Reply from 98.xxx.xxx.1: Destination net unreachable.
Request timed out.
Reply from 98.xxx.xxx.1: Destination net unreachable.
Reply from 98.xxx.xxx.1: Destination net unreachable.

Ping statistics for 10.0.2.15:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),

C:\Users\staff>tracert 10.0.2.15

Tracing route to mage.mage.com [10.0.2.15]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  192.168.1.1
  2     *     adsl-98-xxx-xxx-1.bna.myisp.net [98.xxx.xxx.1]  reports: Destination net unreachable.

Trace complete.

--

Then i renewd dchp automatically and could ping:

C:\Users\staff>ping 192.168.1.105

Pinging 192.168.1.105 with 32 bytes of data:
Reply from 192.168.1.105: bytes=32 time<1ms TTL=64
Reply from 192.168.1.105: bytes=32 time<1ms TTL=64
Reply from 192.168.1.105: bytes=32 time<1ms TTL=64
Reply from 192.168.1.105: bytes=32 time<1ms TTL=64

Ping statistics for 192.168.1.105:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

But i got the magneto error page so I went back and used the same IP but made it static.

Now I still see this page:

http://i53.tinypic.com/ou5xck.jpg

http://i54.tinypic.com/rc81mr.jpg


Jeremy's picture

Well that's progress!

But obviously still not quite there yet.

As for whether it is an issue to post that detail publicly I don't think it's a problem (the only info that gives anything away is "adsl-98-xxx-xxx-1.bna.myisp.net [98.xxx.xxx.1]" but even that only denotes where you are connecting to (ie your ISP). [edited to remove info that may possibly be identifying]

Not sure what that error is about. As it says error reporting is not enabled by default. If you want to do some troubleshooting you'll need to enable error reporting. Some other have had similar issues, you can have a read here and here to perhaps get some ideas.

Well at least i connected!

Well at least i connected! Many thanks for the help. I will check out those links.

Do you happen to know why I can only edit some previous posts?


Jeremy's picture

No worries, glad we got you going

And sorry, no idea why you can only edit some posts. You should be able to edit all of your own posts. I'm a moderator here though so if you want me to edit something for you, send me a message (click my name and use the contact form) detailing which post (perhaps give the link to the post) and what you want edited.

Good luck with it all.

Jeremy's picture

Tidied up the thread

I have tidied up this thread a bit, fixed some typos, removed excess line breaks, fixed some formatting and removed info that may possibly be identifying.

many thanks!

many thanks!


Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)