Category Archives: Servers

SGX-Server KVM-QEMU

Special configuration for SGX server and virtualization environment

The system build is based on the suggested guide available here:

SGX VIRT

(VM creation)

The system allows creating VM using virt-manager

The XML file that defines the basic VM has to be edited

The following example shows the commands and values of the file.

VM creation: uuidgen
qemu-img create -f qcow2 testvm.qcow2 20G

edit the XML (testvm.xml)[edit]

<-- <domain type='kvm'>
--> <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<-- <emulator>/usr/local/bin/qemu</emulator>
--> <emulator>/usr/local/bin/qemu-system-x86_64</emulator>

virsh define testvm.xml

<qemu:commandline>
<qemu:arg value='-cpu'/>
<qemu:arg value='host,+sgx,+sgxlc'/>
<qemu:arg value='-object'/>
<qemu:arg value='memory-backend-epc,id=mem1,size=16M,prealloc'/>
<qemu:arg value='-sgx-epc'/>
<qemu:arg value='id=epc1,memdev=mem1'/>
</qemu:commandline>

The value memory-backend-epc id=mem1 size=16M prealloc
sets up the EPC: you can change the value taking into account how many VMs the system needs to run.

To let the students access the VM directly via ssh, please edit the network section and choose the macvtap with bridge and e1000 driver
This will make the VMs reachable on 203 subnet and then set up a static IP for the server.

Version 0.1.1