Replies: 3 comments
-
On default Ubuntu 24.04Linux config on Ubuntu 24.04 already comes with virtio-vsock and virtio-fs, though as manually loadable modules, so:
|
Beta Was this translation helpful? Give feedback.
-
On Canonical Ubuntu 23.10 TDXThis repo: https://github.com/canonical/tdx/blob/mantic-23.10/ Linux config on Ubuntu 23.10 already comes with virtio-vsock and virtio-fs, though as manually loadable modules, so:
We can use the latest release of TD-Shim ( This OS distro uses a patched QEMU v8.0.4 (to support TDX), and things changed a bit with respect to QEMU's TDX-related command line options. So we must modify diff --git a/tools/gramine-vm.in b/tools/gramine-vm.in
@@ -91,9 +91,9 @@ QEMU_CPU_NUM=${QEMU_CPU_NUM:-"1"}
QEMU_PATH="qemu"
QEMU_VM="-cpu host,host-phys-bits,-kvm-steal-time,pmu=off,+tsc-deadline,+invtsc \
-m $QEMU_MEM_SIZE -smp $QEMU_CPU_NUM"
-QEMU_OPTS="-enable-kvm -vga none -display none -no-reboot -monitor none -machine hpet=off \
- -object memory-backend-file,id=mem,size=$QEMU_MEM_SIZE,mem-path=/dev/shm,share=on \
- -numa node,memdev=mem"
+QEMU_OPTS="-enable-kvm -vga none -display none -no-reboot -monitor none \
+ -object memory-backend-memfd,id=mem,size=$QEMU_MEM_SIZE,private=on \
+ -M memory-backend=mem,hpet=off"
if [ "$TDSHIM_PAL_PATH" == "" ]; then
QEMU_MACHINE="-M q35,kernel_irqchip=split" Interestingly, Note on testing TD-ShimThe TD-Shim documentation on GitHub doesn't mention how to quickly test the example ELF payload on modern Ubuntu + QEMU. Here's the working command on Ubuntu 23.10 TDX and QEMU v8.0.4:
|
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks a lot for publishing this great project and this manual. I'm not sure if gramine-tdx can support Ubuntu 24.04, but I would like to try it on Ubuntu 24.04 as I can not change the OS version. When I tried to compile gramine-tdx on Ubuntu 24.04, I experienced an error related to protobuf.
Protobuf versions:
Any insightful ideas are welcome! @StanPlatinum |
Beta Was this translation helpful? Give feedback.
-
Prerequisites
OS distro used: Ubuntu 22.04.
wget http://www.dest-unreach.org/socat/download/socat-1.8.0.0.tar.gz tar xzf socat-1.8.0.0.tar.gz cd socat-1.8.0.0/ ./configure make sudo make install
Get TDX software stack.
Install Rust
nightly-2023-08-28
, required for TD-Shim. Also install NASM, Clang and LLVM (Ubuntu 22.04 has sufficiently new ones.)Get latest TD-Shim and build it:
Building Gramine-VM/TDX
$ meson setup build-debug/ --werror --buildtype=debug -Dtests=enabled \ -Dskeleton=enabled -Ddirect=enabled -Dsgx=enabled -Dvm=enabled -Dtdx=enabled \ --prefix=$PWD/built-debug $ ninja -C build-debug/ $ ninja -C build-debug/ install
Running Gramine-VM/TDX
Gramine-VM/TDX reuses completely the direct/sgx manifests, Makefiles and etc. So LibOS tests, Examples, CI-Examples should more or less run as is (one may need to adjust
sgx.enclave_size
since VMs require more space).Note: currently for network-based applications, we must manually start
socat
daemon that will proxy VSOCK<->TCP. See examples like Redis and Memcached on how to run.Random notes
gramine-vm
/gramine-tdx
script starts this:Dvm=enabled
orDtdx=enabled
is set (technically, the same should be done for Musl, GCC/libomp, and others)PWD
into Gramine's VM, so that Gramine can construct proper absolute filenames.Beta Was this translation helpful? Give feedback.
All reactions