TurnKey Linux Virtual Appliance Library

Need help Install Turnkey LAMP To Hyper-V

Hi,

I have Downloaded turnkey-lamp-11.1-lucid-x86.iso and have created a new hyper-v to install the Turnkey LAMP Server to a virtual disk. After Installation Done, It Says Cannot Detect My Network Adapter?

I hve created a virtual network adapter pointing torwards my external adpater.

Hope you guys or gals can help abit

Rhank You

Jeremy's picture

I have no experience with Hyper-V

But a quick Google turned up this forum post which looks very useful, particularly this link which seems pretty straighforward. FYI TKL v11.x is based on Ubuntu 10.04. The only things I would add are that anywhere the 'sudo' prefix is used in the terminal it can be omited when used with TKL (TKL default user is already root) and rather than 'vi' I recommend 'nano' as IMO its a more Linux newb friendly command line text editor.

It'd be handy if you document & post back with your findings (especially if you can get it to work, but even if you can't) so others in the same situation can follow your lead.

RE: Issue

 

Getting the Hyper-V drivers up and running at this point in time is actually relatively simple.  The first thing you need to do is to edit /etc/initramfs-tools/modules and add the following lines to the end of it:

hv_vmbus

hv_storvsc

hv_blkvsc

hv_netvsc

Once you have made these changes you will need to run “update-initramfs –u” and reboot.  You will now have the Hyper-V drivers for storage and networking loaded:

This Is Where I Am Unsure

Jeremy's picture

Ok here's what I'd do

Open the designated file for editing with nano (type this at the command line):

nano /etc/initramfs-tools/modules

Then add the text to the end of the file (as stated) so you would just copy-paste the text in (or type it in carefully if that's not possible) so that the last lines of the file look like this:

[...rest of file text finishes here...]
hv_vmbus
hv_storvsc
hv_blkvsc
hv_netvsc

Save and exit with <Ctrl><x>. Then run “update-initramfs –u” and reboot (type this stuff into the terminal):

update-initramfs –u
reboot

Does that help?

I have got the Wordpress

I have got the Wordpress appliance running on Hyper V, now to get the network device working.

This seems easy enough from your post . However when it comes to comand line stuff I get confused as to where I must run the command from  becuase i dont get the reponse i am supposed to get when i run :

nano /etc/initramfs-tools/modules

 

when I log into webshell ...12320 and run the command

-bash: nano/etc/initramfs-tools/modules: No such file or directory 

if I execute the command in Webmin under Command Shell, i get :

>  nano /etc/initramfs-tools/modules
Error opening terminal: unknown.

forgive me for sounding dumb but i am new to this, obviously I am doing something wrong and need some beginners guidance 

thanks in advance 

Jeremy's picture

I have no idea about Hyper-V

But nano is a commandline text editor. It is usually recommended as it is very simple and straightforward and is included in most Linux distros by default (including TKL).

If you try to open a file that doesn't exist with nano then by default it will create the file.

Your first line of code does not include a space between 'nano' and '/etc...' unless thats a typo that'd be your problem. As for using commands in Webmin it's not something I've done so can't help there.

REl

Hi Jeremy, It Works. Thank You.

Is There Any Best practices For Turnkey LAMP? Security? Performance?

Jeremy's picture

Excellent!

And thanks for posting back with confirmation. That will be handy for others I'm sure.

As for your questions re security. IMO TKL is already pretty secure but to lock it down even further I'd disable any servies/apps that you don't use eg if you don't use Webmin, disable it. Also if you aren't behind a firewall already, I'd enable the firewall in TKL and only leave open relevant ports. How you will actually do any of this I'm not 100% sure (because I haven't worried about it myself), but if you need further help I'm happy to try to help you find info.

re

where do i find the htdocs folder?

Jeremy's picture

AFAIK the default Linux doc root is /var/www

At least it is in most (all?) Debian/Ubuntu based distros and it certainly is on TKL.

Please help

I follow instructions mentioned above and when execute command update-initramfs –u get error

.: 13: Cant open /scripts/casper-functions

.: 6: Cant open /scripts/casper-functions

.: 6: Cant open /scripts/casper-functions

any ideas ? This is latest TKL installation...

Please help

Jeremy's picture

These errors can be ignored

Casper is to do with the Live boot feature of the CD/ISO so you can safely ignore these warnings.

Long Boot Time

I actually tried this on a new install and it cause's the virtual machine to boot very slow.  (Almost 2 minutes) Any idea's???

Legacy Network Adapter

An alternative solution is to just add a Legacy Network adapter to the virtual machine.

This can easily be done from the settings of the virtual machine.

This goes for all linux distributions.

Adding the legacy network

Adding the legacy network adapter worked for me on V12 of MediaWiki. I tried to add the lines to the modules file but it didn't work. Added the legacy adapter and it worked perfectly on Hyper-V running on Server 2008 R2.

hyper-v integration for tkl

I've also tried the above, and it doesn't work for me either with the latest LAMP (12) build.

As I'm a linux noob, I have no idea as for how to continue with this issue, as there's almost no valid info on the subject, or the instructions are too complicated for someone like me.

Could someone please tell me if any of the below links would work?
It seems plausible, but then again, I'm not sure if this would work for tkl as well.
Biggest issue for me is the legacy network adapter, which I'd like to work a little faster than 10Mbps...

The thread seems really old, and I can't believe there's nobody else with this issue anymore as MS suppport on this *****

FYI, I'm running Hyper-V server 3 (2012) x64, and the NIC is dedicated to the VM
(not shared with host, so it doesn't even show up under the hosts adapter.
The LAMP tkl is x86 v12 

Please advise me what to do next..

http://piremi.blogspot.com/2012/10/debian-install-integration-services-f...

http://forum.osxlatitude.com/index.php?/topic/1716-install-hyper-v-integ...

Thanks.

Jeremy's picture

They're no good...

Both of those links are for 64 bit Debian and currently TKL is 32 bit only (although that will change with the release of v12.1 - whenever that is released). I have no experience with Hyper-V so I have no idea beyond that.

TBH I have heard nothing but issues with non-Win OS on Hyper-V (I guess Linux support is not a priority for MS). Personally I'd look at another option such as VMware Server (free). I used to use it successfully to host various TKL VMs on Windows Server 2003 a few years ago.

Or better still IMO is to do what I've done at work. I ditched Windows on the hardware and installed the extremely lightweight but powerful ProxmoxVE (Debian based). I then run 1x Windows Server 2008R2, 1x WinXP and 1x Win7 under KVM. I also have multiple TKL servers running as OVZ containers. IMO Win Server runs as well virtualised as it does on hardware (perhaps even better - especially when you can offload a lot of work to Linux VMs).

next link

I've tried Proxmox, and found that it's not suitable for linux noobs like me. I wasted almost a week trying to get it up and running, but I got stuck right from the start with mounting hard-disks. Let alone the RAID I actually wanted to use.

I'm running a windows domain, and the Hyper-V servers fit in great. All management tasks can be done centrally without any additional software; you get free clustering, replication and migration out of the box as well, so that's why I like hyper-v.

Now I think the issue isn't so much MS lack of support for linux, as linux is a community-driven OS.
From the start, people wrote their own drivers for it and that's why I'm surprised to see these "drivers" haven't been released for Linux-builds yet. So in my opinion, it's the Linux community that doesn't seem to have a high priority to make this work well on Hyper-V, and not so much the other way around. No offense, but that's my point of view.

I did some more searching, and came across the site below, which states I can "compile" or update the kernel or whatever that means wiith a custom built version that does include support for Hyper-V.
Now, I'd like to know if this is a safe practice to do on a TKL-built, or would I risk breaking the entire OS? And if it's ok to do, then what kernel should I download, and how should I install it?

I was hoping someone here could point out what would be good practice. I'd like to just download a file, unpack and install it, or get some other nice instructions to make it work. It IS possible, but there's just nobody that has shared the info with the outside world yet it seems.
 

Browse to the link and do a page-search (ctrl-F) for .deb (all the way at the bottom)
http://www.yusufozturk.info/tag/hyper-v-linux

Cheers,

Michael.

Jeremy's picture

If your hardware isn't supported OOTB I can understand that

My experience with Proxmox has been much more successful. I started using it as a complete Linux newb (the same time I started using TKL - about 4-5 yrs ago now...) but I was lucky that all my hardware was supported OOTB so the start of the learning curve was pretty shallow. It's only been in the last year or 2 that I have started using it via the commandline - previously I used the WebUI exclusively and found it very easy to use (although admittedly the v2.x UI is not so intuative IMO). Also I had it running at home for over a year (and got familiar with it) before I installed it at work.  I completely understand that having hardware compatibility issues that make installation difficult would be a showstopper as a Linux newb. Unfortunately, unless you are lucky (or using older hardware), support for newer hardware can sometimes be a bit hit and miss (unless you research and purchase hardware specifically with Linux in mind). Using Intel whever possible definately makes life easier...

As I said I haven't used Hyper-V but I find my setup is pretty sweet. Personally I love Proxmox and wouldn't go back to running a Win Server on hardware again. Once you get your head around it IMO PVE takes so much less maintenance, is much more reliable and stable and uses significantly less resources (meaning more RAM and CPU cycles for VMs). I also find it much easier to get help with Linux issues than MS ones. Anyway though it isn't a competition - different strokes for different folks! :)

As for Hyper-V support for Linux guests... Following your post, I thought I probably should do a little research rather than just spouting my opinion. But first, although technically the Linux kernel could be considered a 'community' development but most of the contributions come from corporations (or at least people being paid for their contributions to Linux by their corporate employer. From what I read, the main barrier to inclusion of Hyper-V support in the Linux kernel has been the MS devs unfamiliarity with how things are done. Code contributors have a number of quite stringent requirements and coding conventions that must be met and code must undergo rigourous testing prior to inclusion in the mainline kernel. The kernel team also require a minimum amount of maintenence for code to remain within the kernel.

Despite the fact that they started contributing code to the kernel team in 2009, most of the Hyper-V code has only made it into the mainline/stable kernel as of v3.4 (mid last year). MS got off to a rocky start with much of their earlier submmitted code rejected for inclusion (due to bugs apparently). I also read that their original motivation for submitting code was not neccessarily to support Linux in Hyper-V, but to avoid prosecution over a breach of the GPL licence, apparently some GPL kernel code made it into Hyper-V. I also suspect that for MS devs to be held to someone else's account is probably a bit different for them.

Another part of the problem for MS is that desite the fact that in 2011 they were one of the top 20 Linux kernel contributors, because of testing and the time lag between kernel.org releasing a kernel and the individual distros including the new kernel, it will be sometime before the code they committed will be found 'in the wild'. Although you'd be pleased to hear that Debian have backported (most?) of the Hyper-V code from kernel 3.4 into 3.2 (as is included in Debian 7/Wheezy - the basis of TKL v13).

This leads me to what I believe is probably the easiest way to get your Hyper-V hosted TKL server running. As mentioned above, TKL v13 will include kernel 3.2 which apparently includes the Hyper-V code already. Unfortunately the devs have only released the Core RC (otherwise I'd just suggest that you use that). But there is a 3.2 backported kernel available for Squeeze (the version of Debian that TKL v12 is based on). Here is a tutorial on installing the backported kernel. Although perhaps the easiest way to go is to just test the v13RC Core ISO and see if it works OOTB.

Going back to your link, from a quick browse it should work and yes you could build your own and the tutorial looks like it pretty much holds your hand so it seems pretty reasonable (despite the fact that in my experience building kernels can be an extremely painful process - I built a custom kernel for my old netbook and it was a great success, but it took me hours and numerous attempts to get the desired effect...). However I note that just above there are instructions on using a pre-built kernel which would be even easier.

Only thing I'm not sure about, is that if you can't boot a Linux server in Hyper-V (or even if you can't get networking working) then you will struggle to follow these instructions. If you can't get the system to boot at all you'll need to rebuild an ISO with the new kernel included (which will need to be done from within Linux)...

TKLPatch could be a good option for rebuilding the ISO with the newer kernel included. Happy to assist if that ends up being your plan. First step would be to install TKL v13RC (I'd go 32 bit to avoid potential issues) and see how you go from there.

Jeremy's picture

FWIW... Proxmox on Hyper-V

Not sure if this is of any use to anyone, but stumbled across this tutorial on how to install Proxmox on Hyper-V. It's quite dated so not sure if it still applies (and/or works)...

This could be a good way for those Hyper-V users who wish to have a look at Proxmox without making any commitment?

Also if you plan on using more than one Linux VM then this will save you plenty of resources (assuming that you install Linux as OpenVZ containers). Linux running under OVZ runs so sweet and uses so few resources so if you have multiple Linux VMs this will save you plenty!

Hyper-V 2012R2 - Gen 1 VM

Using turnkey-wordpress-13.0-wheezy-amd64.iso and creating a Gen 1 VM on Hyper-V 2012R2 I had no issues getting install, configure, and updates.

 

Gen 2 would not boot UFEI SCSI CD and I did not care to dig into resolving it but wanted to share above.

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)