diff --git a/TEST_MAPPING b/TEST_MAPPING
index 11648c4..4c9907f 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -7,9 +7,6 @@
       "name": "ComposHostTestCases"
     },
     {
-      "name": "VirtualizationTestCases.64"
-    },
-    {
       "name": "MicrodroidTestApp"
     },
     {
diff --git a/authfs/tests/common/src/java/com/android/fs/common/AuthFsTestRule.java b/authfs/tests/common/src/java/com/android/fs/common/AuthFsTestRule.java
index 57fef9f..6087eef 100644
--- a/authfs/tests/common/src/java/com/android/fs/common/AuthFsTestRule.java
+++ b/authfs/tests/common/src/java/com/android/fs/common/AuthFsTestRule.java
@@ -99,14 +99,6 @@
         sTestInfo = testInfo;
         TestDevice androidDevice = getDevice();
         sAndroid = new CommandRunner(androidDevice);
-
-        // NB: We can't use assumeTrue because the assumption exception is NOT handled by the test
-        // infra when it is thrown from a class method (see b/37502066). We need to skip both here
-        // and in setUp.
-        if (!androidDevice.supportsMicrodroid()) {
-            CLog.i("Microdroid not supported. Skipping.");
-            return;
-        }
     }
 
     public static void tearDownAndroid() {
diff --git a/tests/Android.bp b/tests/Android.bp
deleted file mode 100644
index 5c1b5c4..0000000
--- a/tests/Android.bp
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (C) 2020 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package {
-    default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-kernel_version = "5.15"
-
-kernel_stem = "kernel_prebuilts-" + kernel_version
-
-cc_test {
-    // ".64" suffix is to work around cts-unit-test which is demanding that all
-    // executables in CTS should have both 32 and 64 ABIs.
-    name: "VirtualizationTestCases.64",
-    test_suites: [
-        "general-tests",
-    ],
-    srcs: [
-        "common.cc",
-        "vsock_test.cc",
-    ],
-    local_include_dirs: ["include"],
-    compile_multilib: "64",
-    data: [
-        ":virt_test_kernel",
-        ":virt_test_initramfs",
-    ],
-    static_libs: [
-        // The existence of the library in the system partition is not guaranteed.
-        // Let's have our own copy of it.
-        "android.system.virtualizationservice-cpp",
-        "libPlatformProperties",
-    ],
-    shared_libs: [
-        "libbase",
-        "libbinder",
-        "liblog",
-        "libutils",
-    ],
-}
-
-cc_defaults {
-    name: "virt_test_guest_binary",
-    static_libs: [
-        "libbase",
-        "liblog",
-    ],
-    static_executable: true,
-    installable: false,
-}
-
-cc_binary {
-    name: "virt_test_vsock_guest",
-    srcs: ["vsock_guest.cc"],
-    stem: "vsock_client",
-    defaults: ["virt_test_guest_binary"],
-}
-
-prebuilt_etc {
-    name: "virt_test_kernel",
-    src: "nofile",
-    arch: {
-        arm64: {
-            src: ":" + kernel_stem + "-arm64",
-        },
-        x86_64: {
-            src: ":" + kernel_stem + "-x86_64",
-        },
-    },
-}
-
-android_filesystem {
-    name: "virt_test_initramfs",
-    deps: [
-        "microdroid_kernel_modules",
-        "virt_test_guest_init",
-        "virt_test_vsock_guest",
-    ],
-    type: "cpio",
-}
diff --git a/tests/AndroidTest.xml b/tests/AndroidTest.xml
deleted file mode 100644
index 68e9c1b..0000000
--- a/tests/AndroidTest.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2020 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<configuration description="Config for Virtualization tests">
-    <option name="test-suite-tag" value="cts" />
-    <option name="config-descriptor:metadata" key="component" value="security" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
-    <!-- Push test binaries to the device. -->
-    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
-        <option name="cleanup" value="true" />
-        <option name="abort-on-push-failure" value="true" />
-        <option name="push-file" key="VirtualizationTestCases.64" value="/data/local/tmp/virt-test/VirtualizationTestCases.64" />
-        <option name="push-file" key="virt_test_kernel"        value="/data/local/tmp/virt-test/kernel" />
-        <option name="push-file" key="virt_test_initramfs.img" value="/data/local/tmp/virt-test/initramfs" />
-    </target_preparer>
-
-    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
-        <option name="force-root" value="true" />
-    </target_preparer>
-
-    <test class="com.android.tradefed.testtype.GTest" >
-        <option name="native-test-device-path" value="/data/local/tmp/virt-test" />
-        <option name="module-name" value="VirtualizationTestCases.64" />
-        <!-- test-timeout unit is ms, value = 2 minutes -->
-        <option name="native-test-timeout" value="120000" />
-    </test>
-</configuration>
diff --git a/tests/common.cc b/tests/common.cc
deleted file mode 100644
index 5d32351..0000000
--- a/tests/common.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <android/sysprop/HypervisorProperties.sysprop.h>
-
-#include "virt/VirtualizationTest.h"
-
-using android::sysprop::HypervisorProperties::hypervisor_protected_vm_supported;
-using android::sysprop::HypervisorProperties::hypervisor_vm_supported;
-
-namespace {
-
-bool isVmSupported() {
-    bool has_capability = hypervisor_vm_supported().value_or(false) ||
-            hypervisor_protected_vm_supported().value_or(false);
-    if (!has_capability) {
-        return false;
-    }
-    const std::array<const char *, 2> needed_files = {
-            "/apex/com.android.virt/bin/crosvm",
-            "/apex/com.android.virt/bin/virtualizationservice",
-    };
-    return std::all_of(needed_files.begin(), needed_files.end(),
-                       [](const char *file) { return access(file, F_OK) == 0; });
-}
-
-} // namespace
-
-namespace virt {
-
-void VirtualizationTest::SetUp() {
-    if (!isVmSupported()) {
-        GTEST_SKIP() << "Device doesn't support KVM.";
-    }
-
-    mVirtualizationService = waitForService<IVirtualizationService>(
-            String16("android.system.virtualizationservice"));
-    ASSERT_NE(mVirtualizationService, nullptr);
-}
-
-} // namespace virt
diff --git a/tests/include/virt/VirtualizationTest.h b/tests/include/virt/VirtualizationTest.h
deleted file mode 100644
index 29509ba..0000000
--- a/tests/include/virt/VirtualizationTest.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "android/system/virtualizationservice/IVirtualMachine.h"
-#include "android/system/virtualizationservice/IVirtualizationService.h"
-#include "binder/IServiceManager.h"
-#include "gtest/gtest.h"
-
-using namespace android;
-using namespace android::system::virtualizationservice;
-
-namespace virt {
-
-class VirtualizationTest : public ::testing::Test {
-protected:
-    void SetUp() override;
-
-    sp<IVirtualizationService> mVirtualizationService;
-};
-
-} // namespace virt
diff --git a/tests/init/Android.bp b/tests/init/Android.bp
deleted file mode 100644
index 1643acd..0000000
--- a/tests/init/Android.bp
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (C) 2020 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package {
-    default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-cc_binary {
-    name: "virt_test_guest_init",
-    srcs: ["main.cc"],
-    static_executable: true,
-    installable: false,
-    static_libs: [
-        "libbase",
-        "liblog",
-        "libmodprobe",
-    ],
-    stem: "init",
-}
diff --git a/tests/init/main.cc b/tests/init/main.cc
deleted file mode 100644
index fe4cc80..0000000
--- a/tests/init/main.cc
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <dirent.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/utsname.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include <cstdlib>
-#include <filesystem>
-#include <fstream>
-#include <iostream>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include <modprobe/modprobe.h>
-
-#include "android-base/logging.h"
-#include "android-base/strings.h"
-
-using namespace android::base;
-
-static constexpr const char MODULE_BASE_DIR[] = "/lib/modules";
-
-bool LoadKernelModules() {
-    struct utsname uts;
-    if (uname(&uts)) {
-        LOG(ERROR) << "Failed to get kernel version.";
-        return false;
-    }
-    int major, minor;
-    if (sscanf(uts.release, "%d.%d", &major, &minor) != 2) {
-        LOG(ERROR) << "Failed to parse kernel version " << uts.release;
-        return false;
-    }
-
-    std::unique_ptr<DIR, decltype(&closedir)> base_dir(opendir(MODULE_BASE_DIR), closedir);
-    if (!base_dir) {
-        LOG(ERROR) << "Unable to open /lib/modules, skipping module loading.";
-        return false;
-    }
-    dirent* entry;
-    std::vector<std::string> module_dirs;
-    while ((entry = readdir(base_dir.get()))) {
-        if (entry->d_type != DT_DIR) {
-            continue;
-        }
-        int dir_major, dir_minor;
-        if (sscanf(entry->d_name, "%d.%d", &dir_major, &dir_minor) != 2 || dir_major != major ||
-            dir_minor != minor) {
-            continue;
-        }
-        module_dirs.emplace_back(entry->d_name);
-    }
-
-    // Sort the directories so they are iterated over during module loading
-    // in a consistent order. Alphabetical sorting is fine here because the
-    // kernel version at the beginning of the directory name must match the
-    // current kernel version, so the sort only applies to a label that
-    // follows the kernel version, for example /lib/modules/5.4 vs.
-    // /lib/modules/5.4-gki.
-    std::sort(module_dirs.begin(), module_dirs.end());
-
-    for (const auto& module_dir : module_dirs) {
-        std::string dir_path(MODULE_BASE_DIR);
-        dir_path.append("/");
-        dir_path.append(module_dir);
-        Modprobe m({dir_path});
-        bool retval = m.LoadListedModules();
-        int modules_loaded = m.GetModuleCount();
-        if (modules_loaded > 0) {
-            return retval;
-        }
-    }
-
-    Modprobe m({MODULE_BASE_DIR});
-    bool retval = m.LoadListedModules();
-    int modules_loaded = m.GetModuleCount();
-    if (modules_loaded > 0) {
-        return retval;
-    }
-
-    return true;
-}
-
-int main(int argc, const char* argv[]) {
-    SetLogger(StderrLogger);
-
-    LOG(INFO) << "Guest VM init process";
-    LOG(INFO) << "Command line: " << Join(std::vector(argv, argv + argc), " ");
-
-    if (clearenv() != EXIT_SUCCESS) {
-        PLOG(ERROR) << "clearenv";
-        return EXIT_FAILURE;
-    }
-
-    LOG(INFO) << "Loading kernel modules...";
-    if (!LoadKernelModules()) {
-        LOG(ERROR) << "LoadKernelModules failed";
-        return EXIT_FAILURE;
-    }
-
-    LOG(INFO) << "Executing test binary " << argv[1] << "...";
-    execv(argv[1], (char**)(argv + 1));
-
-    PLOG(ERROR) << "execv";
-    return EXIT_FAILURE;
-}
diff --git a/tests/nofile b/tests/nofile
deleted file mode 100644
index 9e4b854..0000000
--- a/tests/nofile
+++ /dev/null
@@ -1,2 +0,0 @@
-// This file is used as src of virt_test_kernel module for the architectures
-// other than arm64 and x86_64
diff --git a/tests/vsock_guest.cc b/tests/vsock_guest.cc
deleted file mode 100644
index 884c8a4..0000000
--- a/tests/vsock_guest.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <sys/socket.h>
-
-// Needs to be included after sys/socket.h
-#include <linux/vm_sockets.h>
-
-#include <iostream>
-
-#include "android-base/file.h"
-#include "android-base/logging.h"
-#include "android-base/parseint.h"
-#include "android-base/unique_fd.h"
-
-using namespace android::base;
-
-int main(int argc, const char *argv[]) {
-    SetLogger(StderrLogger);
-
-    unsigned int cid, port;
-    if (argc != 4 || !ParseUint(argv[1], &cid) || !ParseUint(argv[2], &port)) {
-        LOG(ERROR) << "Usage: " << argv[0] << " <cid> <port> <msg>";
-        return EXIT_FAILURE;
-    }
-    std::string msg(argv[3]);
-
-    unique_fd fd(TEMP_FAILURE_RETRY(socket(AF_VSOCK, SOCK_STREAM, 0)));
-    if (fd < 0) {
-        PLOG(ERROR) << "socket";
-        return EXIT_FAILURE;
-    }
-
-    struct sockaddr_vm sa = (struct sockaddr_vm){
-            .svm_family = AF_VSOCK,
-            .svm_port = port,
-            .svm_cid = cid,
-    };
-
-    LOG(INFO) << "Connecting to CID " << cid << " on port " << port << "...";
-    int ret = TEMP_FAILURE_RETRY(connect(fd, (struct sockaddr *)&sa, sizeof(sa)));
-    if (ret < 0) {
-        PLOG(ERROR) << "connect";
-        return EXIT_FAILURE;
-    }
-
-    LOG(INFO) << "Sending message to server...";
-    if (!WriteStringToFd(msg, fd)) {
-        PLOG(ERROR) << "WriteStringToFd";
-        return EXIT_FAILURE;
-    }
-    shutdown(fd.get(), SHUT_WR); // close socket for writing
-
-    // Must not shut down until the server ACKs the message. Shutting down
-    // the VM would otherwise terminate the VMM and reset the server's socket.
-    LOG(INFO) << "Waiting for ACK from the server...";
-    if (!ReadFdToString(fd, &msg)) {
-        PLOG(ERROR) << "ReadFdToString";
-        return EXIT_FAILURE;
-    }
-    shutdown(fd.get(), SHUT_RD); // close socket for reading
-
-    LOG(INFO) << "Exiting...";
-    return EXIT_SUCCESS;
-}
diff --git a/tests/vsock_test.cc b/tests/vsock_test.cc
deleted file mode 100644
index 1460660..0000000
--- a/tests/vsock_test.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <android/sysprop/HypervisorProperties.sysprop.h>
-#include <linux/kvm.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <unistd.h>
-
-// Needs to be included after sys/socket.h
-#include <linux/vm_sockets.h>
-
-#include <algorithm>
-#include <array>
-#include <iostream>
-#include <optional>
-
-#include "android-base/file.h"
-#include "android-base/logging.h"
-#include "android-base/parseint.h"
-#include "android-base/unique_fd.h"
-#include "android/system/virtualizationservice/VirtualMachineConfig.h"
-#include "android/system/virtualizationservice/VirtualMachineRawConfig.h"
-#include "virt/VirtualizationTest.h"
-
-#define KVM_CAP_ARM_PROTECTED_VM 0xffbadab1
-
-using namespace android::base;
-using namespace android::os;
-
-namespace virt {
-
-static constexpr int kGuestPort = 45678;
-static constexpr const char kVmKernelPath[] = "/data/local/tmp/virt-test/kernel";
-static constexpr const char kVmInitrdPath[] = "/data/local/tmp/virt-test/initramfs";
-static constexpr const char kVmParams[] = "rdinit=/bin/init bin/vsock_client 2 45678 HelloWorld";
-static constexpr const char kTestMessage[] = "HelloWorld";
-static constexpr const char kAckMessage[] = "ACK";
-static constexpr const char kPlatformVersion[] = "~1.0";
-
-/** Returns true if the kernel supports unprotected VMs. */
-bool isUnprotectedVmSupported() {
-    return android::sysprop::HypervisorProperties::hypervisor_vm_supported().value_or(false);
-}
-
-TEST_F(VirtualizationTest, TestVsock) {
-    if (!isUnprotectedVmSupported()) {
-        GTEST_SKIP() << "Skipping as unprotected VMs are not supported on this device.";
-    }
-
-    binder::Status status;
-
-    unique_fd server_fd(TEMP_FAILURE_RETRY(socket(AF_VSOCK, SOCK_STREAM, 0)));
-    ASSERT_GE(server_fd, 0) << strerror(errno);
-
-    struct sockaddr_vm server_sa = (struct sockaddr_vm){
-            .svm_family = AF_VSOCK,
-            .svm_port = kGuestPort,
-            .svm_cid = VMADDR_CID_ANY,
-    };
-
-    int ret = TEMP_FAILURE_RETRY(bind(server_fd, (struct sockaddr *)&server_sa, sizeof(server_sa)));
-    ASSERT_EQ(ret, 0) << strerror(errno);
-
-    LOG(INFO) << "Listening on port " << kGuestPort << "...";
-    ret = TEMP_FAILURE_RETRY(listen(server_fd, 1));
-    ASSERT_EQ(ret, 0) << strerror(errno);
-
-    VirtualMachineRawConfig raw_config;
-    raw_config.kernel = ParcelFileDescriptor(unique_fd(open(kVmKernelPath, O_RDONLY | O_CLOEXEC)));
-    raw_config.initrd = ParcelFileDescriptor(unique_fd(open(kVmInitrdPath, O_RDONLY | O_CLOEXEC)));
-    raw_config.params = kVmParams;
-    raw_config.protectedVm = false;
-    raw_config.platformVersion = kPlatformVersion;
-
-    VirtualMachineConfig config(std::move(raw_config));
-    sp<IVirtualMachine> vm;
-    status = mVirtualizationService->createVm(config, std::nullopt, std::nullopt, &vm);
-    ASSERT_TRUE(status.isOk()) << "Error creating VM: " << status;
-
-    int32_t cid;
-    status = vm->getCid(&cid);
-    ASSERT_TRUE(status.isOk()) << "Error getting CID: " << status;
-    LOG(INFO) << "VM starting with CID " << cid;
-
-    status = vm->start();
-    ASSERT_TRUE(status.isOk()) << "Error starting VM: " << status;
-
-    LOG(INFO) << "Accepting connection...";
-    struct sockaddr_vm client_sa;
-    socklen_t client_sa_len = sizeof(client_sa);
-    unique_fd client_fd(
-            TEMP_FAILURE_RETRY(accept(server_fd, (struct sockaddr *)&client_sa, &client_sa_len)));
-    ASSERT_GE(client_fd, 0) << strerror(errno);
-    LOG(INFO) << "Connection from CID " << client_sa.svm_cid << " on port " << client_sa.svm_port;
-
-    LOG(INFO) << "Reading message from the client...";
-    std::string msg;
-    ASSERT_TRUE(ReadFdToString(client_fd, &msg)) << strerror(errno);
-    LOG(INFO) << "Received message: " << msg;
-
-    // The client is waiting for a response to signal it can shut down.
-    LOG(INFO) << "Replying with '" << kAckMessage << "'...";
-    ASSERT_TRUE(WriteStringToFd(kAckMessage, client_fd));
-
-    ASSERT_EQ(msg, kTestMessage);
-}
-
-TEST_F(VirtualizationTest, RejectIncompatiblePlatformVersion) {
-    VirtualMachineRawConfig raw_config;
-    raw_config.kernel = ParcelFileDescriptor(unique_fd(open(kVmKernelPath, O_RDONLY | O_CLOEXEC)));
-    raw_config.initrd = ParcelFileDescriptor(unique_fd(open(kVmInitrdPath, O_RDONLY | O_CLOEXEC)));
-    raw_config.params = kVmParams;
-    raw_config.platformVersion = "~2.0"; // The current platform version is 1.0.0.
-
-    VirtualMachineConfig config(std::move(raw_config));
-    sp<IVirtualMachine> vm;
-    auto status = mVirtualizationService->createVm(config, std::nullopt, std::nullopt, &vm);
-    ASSERT_FALSE(status.isOk());
-}
-
-} // namespace virt
