Skip to content

Comments

docs: Guide to add new mkosi images for new OS support in sev-certify…#235

Open
LakshmiSaiHarika wants to merge 1 commit intoAMDEPYC:mainfrom
LakshmiSaiHarika:mkosi-doc-add-new-images
Open

docs: Guide to add new mkosi images for new OS support in sev-certify…#235
LakshmiSaiHarika wants to merge 1 commit intoAMDEPYC:mainfrom
LakshmiSaiHarika:mkosi-doc-add-new-images

Conversation

@LakshmiSaiHarika
Copy link
Contributor

This PR adds documentation on how to create, test and publish new guest/host images to add new OS support in this sev-certify project.

… project

Signed-off-by: Harika Nittala <lnittala@amd.com>
## System Set Up
Install mkosi-v25.3 on the system to match mkosi version present in sev-certify GH project:

- **Option 1:** Install mkosi version 25.3 directly on the supported operating systems using package manager

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we do when we move to a new version of mkosi? Will we update the docs or something else?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also - add a period (.) after the word "manager".

Copy link
Contributor Author

@LakshmiSaiHarika LakshmiSaiHarika Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we do when we move to a new version of mkosi?

As per the current build-and-release.yaml workflow, we are installing the mkosi package in the Ubuntu Plucky version.
image
As per mkosi packaging status, mkosi version 25.3 is available in ubuntu plucky (Ubuntu 25.10)
image

Will we update the docs or something else?

Sure, I can update the docs in future if there is any update in mkosi version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer not having to update manually, can we just rely on asking the user to check that link for the latest ubuntu version?

Copy link

@benland72 benland72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, but needs a little fine tuning.

## System Set Up
Install mkosi-v25.3 on the system to match mkosi version present in sev-certify GH project:

- **Option 1:** Install mkosi version 25.3 directly on the supported operating systems using package manager

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also - add a period (.) after the word "manager".

```
Check if mkosi version 25.3 is installed correctly:
```
mkosi --version

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should show what the expected output is from the at command so that users can validate that it matches what they see.

```
mkosi --version
```
Ensure QEMU and OVMF guest firmwares are installed to test the launch of built mkosi images on the system.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there instructions some place for how the user can validate this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can add additional lines to validate this

### Configure and Build new Host Image
The new host image for the sev-certify can be built using the following steps:

1. **Create a mkosi config for the new host image:** New mkosi configuration to make new host image should be created under `sev-certify/images/host-<new-os-name>-<new-os-release>` folder:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd reword New mkosi configuration to make new host image as The mkosi configuration for creating the new host image....
Is it a configuration file? You don't specify a filename in the example

Copy link
Contributor Author

@LakshmiSaiHarika LakshmiSaiHarika Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will update this with the filename.

```
[Include]
# Include required modules in the host image
Include=../../modules/host

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the preview all of the configuration details show as underlined. Not sure if that's just a preview issue with the markdown or some other formatting issue?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/LakshmiSaiHarika/snpcert/blob/mkosi-doc-add-new-images/docs/how-to-add-mkosi-images.md
I think it's just a preview issue - you can see the normal version in Harika's branch above

# Add required host os packages
Packages= <add-host-os-packages>
```
2. **Build new host image using mkosi:** New guest image can be built in the system from sev-certify root directory using mkosi tool as follows:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The heading here is to build a new host image, but the sub-heading refers to building a new guest image. Is that on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for catching this point, it is a typo here.
Sure, I will update

Packages= <add-guest-os-packages>
```

2. **Build new host image using mkosi:** New guest image can be built from sev-certify root directory in the system using mkosi tool as follows:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as line 56

EOF
```

Launch the built host/guest image using QEMU on the QEMU enabled KVM hypervisor host:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/QEMU enabled/QEMU-enabled/

@@ -0,0 +1,128 @@
# Create, test and publish new guest/host images

Users can create and publish new host or guest images in sev-certify with mkosi tool in the following steps:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to mention that this is for new OS support, as in the PR title?

```
2. **Build new host image using mkosi:** New guest image can be built in the system from sev-certify root directory using mkosi tool as follows:
```
mkosi --image-id=host-<new-distro>-<new-release> \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if other people have run into this often, but on ubuntu there are permission errors out of the box related to apparmor, documented here: systemd/mkosi#3265. Can run sysctl systemwide or make an exception for mkosi. I believe in the build scripts it uses sudo, so may be worth linking to that issue here briefly.


guest_image="$1"

ovmf_path="${2:-/usr/share/edk2/ovmf/OVMF_CODE.fd}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would mention somewhere the other common ovmf path - /usr/share/ovmf/OVMF.amdsev.fd

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/usr/share/ovmf/OVMF.amdsev.fd OVMF path requires the use of additional QEMU parameters with SEV.

Are we just testing builthost/guest-mkosi-images using simple guest launch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see, I didn't realize that was the case, that's probably my other issue. My install didn't come with that version, will try to find it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok on ubuntu it appears to be at: /usr/share/ovmf/OVMF.fd

-nographic \
-m 2G \
-bios "${ovmf_path}" \
-kernel "${guest_image}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this qemu command fails to find the image for me on my ubuntu dev server:

BdsDxe: failed to load Boot0001 "Grub Bootloader" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(B5AE312C-BC8A-43B1-9C62-EBB826DD5D07): Not Found
BdsDxe: No bootable option was found.

If I add all the sev parameters it starts working for guest images for me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

host images appears to fail with some resources issue - tried giving it 16G memory but still got the same error. Not sure if this is some issue with my configuration or ubuntu.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as mentioned earlier, this was b/c I was using the sev-enabled firmware. But even with the non-sev firmware, host image is still not booting for me: ../src/boot/linux.c:153@linux_exec: Error starting kernel image: Out of resources - is this testing method only valid for guest images?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, on my dev box, the host image took a little longer boot time compared to the guest image, but later comes up with a login page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants