microsoft / packer-hyperv

Hyperv plugin for Packer.io
Other
82 stars 33 forks source link

Allow creation of VMs with different OS than Windows Server 2012 #10

Open pvandervelde opened 10 years ago

pvandervelde commented 10 years ago

It looks like at the moment only VMs with a Windows Server 2012 OS can be created if I read builder.go (lines 174 - 187) correctly. It would be awesome if packer could create other OS's on Hyper-V as well, e.g. Win7, Win8 and any flavor of Linux.

pvandervelde commented 10 years ago

@v-vlshch Anybody have any idea on what needs to be done to move this forward? I unfortunately have little time and no experience with Go :( but it would be awesome if we could get this code extended to work with different OSes.

uchagani commented 10 years ago

Couldn't you just fork this repo and add the other Windows versions yourself?

pvandervelde commented 10 years ago

If I had time then yes I could do that, but it would be nicer if all that code was in one spot and I was hoping that there was some momentum behind this plugin. On the other hand when I have time to play with this more I might be able to add the additional Windows versions etc.

vladimir-shcherbakov commented 10 years ago

@eduardkoller Are we going to move this forward?

kouk commented 10 years ago

@v-vlshch @eduardkoller yes, please tell, is this going to happen anytime soon? I can help with testing and perhaps even bug fixes.

petro-rudenko commented 9 years ago

Is there a way to build a linux image on hyper-v with this plugin?

vladimir-shcherbakov commented 9 years ago

Unfortunately, the plugin targets restricted by Windows Server 2012.

pbolduc commented 9 years ago

I have been working on a fork that supports an expanded OS selection. Linux is on backlog but I am currently focusing on supporting all supported version of Windows OS first.

In the other providers, like Virtual Box, they are able to send key strokes to the console to instruct the linux installer to use a install template. Is there another way to do this? I do not think we can send key strokes to the Hyper-V console of a VM.

uchagani commented 9 years ago

What do you mean by "install template" On Dec 12, 2014 5:37 PM, "Phil Bolduc" notifications@github.com wrote:

I have been working on a fork https://github.com/pbolduc/packer-hyperv that supports an expanded OS selection. Linux is on backlog but I am currently focusing on supporting all supported version of Windows OS first.

In the other providers, like Virtual Box, they are able to send key strokes to the console to instruct the linux installer to use a install template. Is there another way to do this? I do not think we can send key strokes to the Hyper-V console of a VM.

— Reply to this email directly or view it on GitHub https://github.com/MSOpenTech/packer-hyperv/issues/10#issuecomment-66846450 .

pbolduc commented 9 years ago

See 'Boot Command' in VIRTUALBOX BUILDER (FROM AN ISO)

_The boot_command configuration is very important: it specifies the keys to type when the virtual machine is first booted in order to start the OS installer. This command is typed after bootwait, which gives the virtual machine some time to actually load the ISO.

pbolduc commented 9 years ago

By install template, I think I meant a config file for the linux environment. However, I just read How do I create a completely unattended install of Ubuntu? and it appears you do not need to have to send any key strokes. I would assume something similar can be done for other linix distros, ie CentOS, etc

andyburton commented 9 years ago

For Debian you use preseed to specify the options during install - https://wiki.debian.org/DebianInstaller/Preseed e.g. https://github.com/box-cutter/debian-vm/blob/master/http/preseed.cfg

Currently we use Packer to build virualbox/vmware/aws images using the following, but we do not have the ability to use packer for hyper-v as there is no plugin to support the build commands required -

        "boot_command": [
            "<esc><wait>",
            "install",
            " auto",
            " url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
            " debian-installer=en_US",
            " locale=en_US",
            " keymap=us",
            " netcfg/get_hostname=vagrant",
            " netcfg/get_domain=vm ",
            "<enter>"
        ],

+1 for a hyper-v packer plugin that supports Debian/Ubuntu :)

spuder commented 9 years ago

+1 Very eagerly looking forward to linux support

marcofranssen commented 9 years ago

+1 would love to have the hyperv builder so I can run my VM's on hyper-v and also be able to deploy them to azure.

marcofranssen commented 9 years ago

Would also be awesome to have some documentation on the packer website on how to use the hyper-v stuff with packer. Could someone experienced with the hyper-v stuff add some docs on the packer website, this also might give a boost to people interesting to further develop the hyper-v support. Probably few people know of the existence of packer + hyper-v. A pull request here should make the docs appear on the packer website. https://github.com/mitchellh/packer/tree/master/website

taliesins commented 9 years ago

See: https://github.com/mitchellh/packer/pull/2576 for full support of other operating system with Hyper-V