Skip to content

Latest commit

 

History

History
66 lines (42 loc) · 3.42 KB

default_images.md

File metadata and controls

66 lines (42 loc) · 3.42 KB

Building

Tutorial: Build the Default ISO

In this tutorial, we will create a bootable ISO image for installing CBL-Mariner to either a physical machine or virtual hard drive.

The toolkit ships with several image configurations. The image config files define how a CBL-Mariner image is laid out once built or installed. Each image config will also include a list of packages to install.

Build ISO

Build the default ISO by invoking the following build command from the CBL-MarinerTutorials/toolkit folder.

sudo make iso CONFIG_FILE=./imageconfigs/full.json

The first time make image is invoked, the toolkit downloads the necessary toolchain packages from the CBL-Mariner package repo at packages.microsoft.com. These toolchain packages are the standard set needed to build any local packages. Once the toolchain is ready, make automatically proceeds to build any local packages. In this case, the core repo's image configs do not use any of the packages located in the Tutorial repo so nothing will be built. make will then assemble the packages gathered from the package server to build the specified image.

The resulting ISO is placed in the CBL-MarinerTutorials/out/images/full folder.

Use Hyper-V to Boot Your ISO Installer

See Use Hyper-V to Boot Your ISO Installer for instructions on using Hyper-V to boot the ISO.

Tutorial: Build a Default VHD or VHDX

The tools can also create offline images that can be directly booted.

Build VHD or VHDX

The tools can also build offline images for direct use in VMs or as containers:

# VHDX
sudo make image CONFIG_FILE=./imageconfigs/core-efi.json 
# VHD
sudo make image CONFIG_FILE=./imageconfigs/core-legacy.json

The resulting images are placed in the CBL-MarinerTutorials/out folder:

VHDX: CBL-MarinerTutorials/out/images/core-efi/ VHD: CBL-MarinerTutorials/out/images/core-legacy/

Build the cloud-init configuration image

No user account is provisioned by default. To sign-in to these images at runtime, the sample meta-user-data.iso image must also be built and installed in your VM's CD drive. The cloud-init service will detect the ISO and provision a user account and password or SSH Key.

Before you can build the meta-user-data.iso image you will need to customize the user-data configuration file. From the toolkit folder, the file can be found in ./resources/assets/meta-user-data/user-data. Using an editor set a username and password or SSH Key. After applying your edits generate the meta-user-data.iso file as follows:

# Build the cloud-init configuration image
# The output image is ../out/images/meta-user-data.iso
sudo make meta-user-data

Use Hyper-V to Boot Your Image

See Use Hyper-V to Boot Your Offline Image for instructions on using Hyper-V to boot the image and add a user profile with the meta-user-data.iso file.