> For the complete documentation index, see [llms.txt](https://docs.enclaive.cloud/sylica/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enclaive.cloud/sylica/documentation/getting-started/launch-an-amd-sev-snp-vm.md).

# Launch an AMD SEV-SNP VM

{% hint style="info" %}
For ready-to-use Linux boot artifcats including Universal Kernel Images and Initrd for attestable boot, see [Buckypaper](broken://spaces/JCiJp92CK5rDzO9DECIa).
{% endhint %}

## Step-by-step Guide

Use:

```
sylica-sev
```

for AMD SEV-SNP confidential virtual machines.

The resulting architecture is:

```
AMD EPYC
    │
    ▼
AMD Secure Processor
    │
    ▼
SEV-SNP
    │
    ▼
KVM/QEMU
    │
    ▼
sylica-sev / CVMF.fd
    │
    ▼
SEV-SNP guest
```

### Verify host support

Check for the AMD KVM module:

```bash
lsmod | grep kvm_amd
```

Check the kernel log:

```bash
sudo dmesg | grep -i -E 'sev|snp'
```

Depending on the host configuration, useful checks may also include:

```bash
ls -l /dev/sev
```

and:

```bash
cat /sys/module/kvm_amd/parameters/sev 2>/dev/null
```

The exact host setup depends on the kernel, QEMU version, system firmware, and AMD platform generation.

### Check QEMU SEV-SNP support

Verify that your QEMU build exposes the SNP confidential-guest object:

```bash
qemu-system-x86_64 \
    -object help | grep sev
```

A QEMU build with SNP support should expose:

```
sev-snp-guest
```

### Select the firmware

```bash
CVMF=~/cvmf/sylica-sev/CVMF.fd
```

### Launch

A minimal SEV-SNP QEMU configuration is:

```bash
qemu-system-x86_64 \
    -enable-kvm \
    -machine q35,confidential-guest-support=sev0 \
    -cpu host \
    -smp 4 \
    -m 4G \
    -object sev-snp-guest,id=sev0,cbitpos=51,reduced-phys-bits=1 \
    -bios "$CVMF" \
    -drive file=guest.qcow2,format=qcow2,if=virtio \
    -device virtio-net-pci,netdev=net0 \
    -netdev user,id=net0 \
    -nographic
```

The two important confidential-computing parameters are:

```
-object sev-snp-guest,id=sev0,...
```

which creates the SEV-SNP guest object, and:

```
-machine q35,confidential-guest-support=sev0
```

which associates that object with the VM.

#### Host-specific parameters

The values:

```
cbitpos
reduced-phys-bits
```

describe characteristics of the AMD host and must match the target platform.

The command above uses:

```
cbitpos=51
reduced-phys-bits=1
```

as a common SEV-SNP example. Do not assume these values are correct for every AMD system.

For production deployments, derive the values from the target host and QEMU/KVM environment.

### Install an operating system

To boot an installation ISO:

```bash
qemu-system-x86_64 \
    -enable-kvm \
    -machine q35,confidential-guest-support=sev0 \
    -cpu host \
    -smp 4 \
    -m 4G \
    -object sev-snp-guest,id=sev0,cbitpos=51,reduced-phys-bits=1 \
    -bios "$CVMF" \
    -drive file=guest.qcow2,format=qcow2,if=virtio \
    -cdrom ubuntu.iso \
    -boot order=d \
    -device virtio-net-pci,netdev=net0 \
    -netdev user,id=net0
```

After installation, remove:

```
-cdrom ubuntu.iso
-boot order=d
```

### Production note

Successfully starting an SNP VM does not establish that it should be trusted.

A production workflow should also verify the hardware attestation evidence against an expected policy:

```
CVMF release
     │
     ▼
expected launch state
     │
     ▼
SEV-SNP attestation report
     │
     ▼
verification
     │
     ▼
policy decision
```
