support docker without kvm (#282)

This commit is contained in:
Jiarui Yao
2025-07-23 21:31:43 -07:00
committed by GitHub
parent bf78b6d05e
commit 4fd8b5be0a

View File

@@ -97,11 +97,20 @@ class DockerProvider(Provider):
self.vlc_port = self._get_available_port(8080)
# Start container while still holding the lock
# Check if KVM is available
devices = []
if os.path.exists("/dev/kvm"):
devices.append("/dev/kvm")
logger.info("KVM device found, using hardware acceleration")
else:
self.environment["KVM"] = "N"
logger.warning("KVM device not found, running without hardware acceleration (will be slower)")
self.container = self.client.containers.run(
"happysixd/osworld-docker",
environment=self.environment,
cap_add=["NET_ADMIN"],
devices=["/dev/kvm"],
devices=devices,
volumes={
os.path.abspath(path_to_vm): {
"bind": "/System.qcow2",