Ubuntu and Windows Packer images for Hyper-V builder
- creates base image from ubuntu server .iso
- uses packer Hyper-V ISO builder
- creates Generation 2 Images
- boots to installer using preseed config
- username and password is setup in the boot command passing
ssh_username
andssh_password
packer template variables- you can provide either interactively or using environment variables when calling the build script
.\ubuntu\Build.ps1
- you can provide either interactively or using environment variables when calling the build script
- use as baseline for other images.
- based on: https://github.com/boxcutter/ubuntu
- made sure the template creates Geneneration 2 VM
- made sure the template does not contantain hard-coded username, password and other sensitive environment variables
- generate the answer ISO automatically on build
- creates ubuntu server image from ubuntu-base image
- adds the Host SSD Public key to the image so you can ssh without password
- adds
ssh_username
to thesudoers
so you can sudo without password
Creates ubuntu desktop image from ubuntu-base image.
- vmcx images that can be used on top of
ubuntu-server
. You can also usevmcx
images on top of othervmcx
images - see.\ubuntu\customize\ExampleBuilds\BuildGithubAgentDocker.ps1
- images include
- docker
- github agent
- k3s
- microk8s
- ansible
- run powershell as local admin
-
cd .\ubuntu\ExampleBuilds\
- run an example build e.g.
BuildUbuntuBase.ps1
- run powershell as local admin
-
cd .\ubuntu\customize\ExampleBuilds\
- run an example build e.g.
BuildUbuntuDocker.ps1
- Run powershell as local admin
-
cd .\ubuntu
- Run
ImportVM.ps1
providingTemplateName
that matches one from.\ubuntu\ImagesOutput\
. Optionally provide VM name e.g:ImportVM.ps1 -TemplateName ubuntu-server -VmName my-test-server
- base images for Windows
- 10
- Server 2016
- Serer 2019
- start from .ISOs
- create Generation 2 Images
- floppy disks are not avialable there so we are forced to create Answer ISO instead that is used for the unattended install
- to do this is used mkisofts.exe
- the generated ISO is passed to the packer image via
secondary_iso_images
- the generated ISO is passed to the packer image via
- the main script that generates the iso is
.\windows\base\baseAnswerIso\GenerateBaseAnswerIso.ps1
- it generates
Autounattend.xml
populating the image username, password and other environment specific variables passed toGenerateBaseAnswerIso.ps1
- copies the helper files used in
Autounattend.xml
durring the unattended windows install
- it generates
- based on: https://github.com/StefanScherer/packer-windows
- made sure the templates create Geneneration 2 VMs
- made sure templates do not contantain hard-coded username, password and other sensitive environment variables
- generate the answer ISO automatically on build
- run powershell as local admin
-
cd .\windows\base\ExampleBuilds\
- run an example build e.g.
BuildWin2019Core.ps1
- example vmcx customization image that installs IIS
- depends on AnswerIso to provide
SysprepUnattend.xml
to generalize the image- see
.\windows\answerIso\GenerateSysprepAnswerIso.ps1
- see
- run powershell as local admin
-
cd .\windows\customize\
- run an example build e.g.
ExampleBuildIis.ps1
- Run powershell as local admin
-
cd .\windows
- Run
ImportVM.ps1
providingTemplateName
that matches one from.\windows\ImagesOutput\
. Optionally provide VM name e.g:ImportVM.ps1 -TemplateName win2019-base -VmName my-win2019