vaggeliskls / windows-in-docker-container

Deploy and manage a Windows OS (x64) seamlessly using Vagrant VM, libvirt, and docker-compose. This innovative approach integrates smoothly into existing workflows, providing an efficient way of containerizing Windows OS for better resource allocation and convenience.
MIT License
70 stars 12 forks source link

Call to virDomainCreate failed #13

Open anapolima opened 6 months ago

anapolima commented 6 months ago

I'm facing this error

/root/.vagrant.d/gems/3.1.4/gems/fog-libvirt-0.12.0/lib/fog/libvirt/requests/compute/vm_action.rb:7:in `create': Call to virDomainCreate failed: unable to open '/sys/fs/cgroup/machine/qemu-1-default.libvirt-qemu/': No such file or directory (Libvirt::Error)

Have no idea what it could be

vaggeliskls commented 6 months ago

Hey @anapolima,

Thanks for your feedback.

Could you please share some information about your system host? I would appreciate details such as your Operating System, architecture, and Docker version.

You could attempt to run the program without the volume, just in case. Here is the code you can use:

version: "3.9"

services:
  win10:
    image: ghcr.io/vaggeliskls/windows-in-docker-container:latest
    env_file: .env
    stdin_open: true
    tty: true
    privileged: true
    ports:
      - 3389:3389

Please share your results along with any other information that could help us identify the issue.

Thank you!

jbrozy commented 6 months ago

Hello, i think i ran into the same issue. I have also tried it without the volume.

My System Configuration is: Linux Ubuntu-2204-jammy-amd64-base 5.15.0-105-generic #115-Ubuntu SMP Mon Apr 15 09:52:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

The output from the docker-compose logs is the following:

grafik

win10_1 | ==> default: Starting domain. win10_1 | ==> default: Removing domain... win10_1 | ==> default: Deleting the machine folder win10_1 | /root/.vagrant.d/gems/3.1.4/gems/fog-libvirt-0.12.0/lib/fog/libvirt/requests/compute/vm_action.rb:7:in create': Call to virDomainCreate failed: unable to open '/sys/fs/cgroup/machine/qemu-1-default.libvirt-qemu/': No such file or directory (Libvirt::Error) win10_1 | from /root/.vagrant.d/gems/3.1.4/gems/fog-libvirt-0.12.0/lib/fog/libvirt/requests/compute/vm_action.rb:7:invm_action' win10_1 | from /root/.vagrant.d/gems/3.1.4/gems/fog-libvirt-0.12.0/lib/fog/libvirt/models/compute/server.rb:76:in start' win10_1 | from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/start_domain.rb:608:incall'

webzit commented 6 months ago

Looks like I might face the same issue. Host system is Debian 6.1.90-1. Docker runs as root and no other unusual configuration.

Docker version 26.1.3, build b72abbb Docker Compose version v2.27.0


/root/.vagrant.d/gems/3.1.4/gems/fog-libvirt-0.12.0/lib/fog/libvirt/requests/compute/vm_action.rb:7:in `create': Call to virDomainCreate failed: unable to open '/sys/fs/cgroup/machine/qemu-1-default.libvirt-qemu/': No such file or directory (Libvirt::Error)```
anapolima commented 6 months ago

Hi, @vaggeliskls! I was on Ubuntu-2204-jammy. Can't remember the Docker version, also can't check (I ended booting the machine with Windows). I appreciate your attention. You can still help @xaeto and @webzit

ajpenner commented 5 days ago

I hit the same issue too, running on Ubuntu 24.04, docker version 27.3.1 After commenting out the volume mount and running docker compose up

[+] Running 1/1
 ✔ Container rdp-win10-1  Recreated                                                                                                 0.7s
Attaching to win10-1
win10-1  | Bringing machine 'default' up with 'libvirt' provider...
win10-1  | ==> default: Checking if box 'peru/windows-server-2022-standard-x64-eval' version '20231201.01' is up to date...
win10-1  | [fog][WARNING] Unrecognized arguments: libvirt_ip_command
win10-1  | ==> default: Created volume larger than box defaults, will require manual resizing of
win10-1  | ==> default: filesystems to utilize.
win10-1  | ==> default: Uploading base box image as volume into Libvirt storage...
==> default: Creating image (snapshot of base box volume).
win10-1  | ==> default: Creating domain with the following settings...
win10-1  | ==> default:  -- Name:              _default
win10-1  | ==> default:  -- Description:       Source: /Vagrantfile
win10-1  | ==> default:  -- Domain type:       kvm
win10-1  | ==> default:  -- Cpus:              4
win10-1  | ==> default:  -- Feature:           acpi
win10-1  | ==> default:  -- Feature:           apic
win10-1  | ==> default:  -- Feature:           pae
win10-1  | ==> default:  -- Feature (HyperV):  name=relaxed, state=on
win10-1  | ==> default:  -- Feature (HyperV):  name=synic, state=on
win10-1  | ==> default:  -- Feature (HyperV):  name=vapic, state=on
win10-1  | ==> default:  -- Feature (HyperV):  name=vpindex, state=on
win10-1  | ==> default:  -- Clock offset:      utc
win10-1  | ==> default:  -- Memory:            8000M
win10-1  | ==> default:  -- Base box:          peru/windows-server-2022-standard-x64-eval
win10-1  | ==> default:  -- Storage pool:      default
win10-1  | ==> default:  -- Image(vda):        /var/lib/libvirt/images/_default.img, virtio, 100G
win10-1  | ==> default:  -- Disk driver opts:  cache='default'
win10-1  | ==> default:  -- Graphics Type:     spice
win10-1  | ==> default:  -- Graphics Websocket:
win10-1  | ==> default:  -- Graphics Port:
win10-1  | ==> default:  -- Graphics IP:
win10-1  | ==> default:  -- Graphics Password: Not defined
win10-1  | ==> default:  -- Video Type:        qxl
win10-1  | ==> default:  -- Video VRAM:        16384
win10-1  | ==> default:  -- Video 3D accel:    false
win10-1  | ==> default:  -- Sound Type:        ich6
win10-1  | ==> default:  -- Keymap:            en-us
win10-1  | ==> default:  -- TPM Backend:       passthrough
win10-1  | ==> default:  -- INPUT:             type=mouse, bus=ps2
win10-1  | ==> default:  -- CHANNEL:             type=spicevmc, mode=
win10-1  | ==> default:  -- CHANNEL:             target_type=virtio, target_name=com.redhat.spice.0
win10-1  | ==> default:  -- CHANNEL:             type=unix, mode=
win10-1  | ==> default:  -- CHANNEL:             target_type=virtio, target_name=org.qemu.guest_agent.0
win10-1  | ==> default:  -- RNG device model:  random
win10-1  | ==> default: Creating shared folders metadata...
win10-1  | ==> default: Updating domain definition due to configuration change
win10-1  | ==> default: Starting domain.
win10-1  | ==> default: Removing domain...
win10-1  | ==> default: Deleting the machine folder
win10-1  | /root/.vagrant.d/gems/3.1.4/gems/fog-libvirt-0.13.1/lib/fog/libvirt/requests/compute/vm_action.rb:7:in `create': Call to virDomainCreate failed: unable to open '/sys/fs/cgroup/machine/qemu-1-default.libvirt-qemu/': No such file or directory (Libvirt::Error)
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/fog-libvirt-0.13.1/lib/fog/libvirt/requests/compute/vm_action.rb:7:in `vm_action'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/fog-libvirt-0.13.1/lib/fog/libvirt/models/compute/server.rb:81:in `start'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/start_domain.rb:608:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/set_boot_order.rb:22:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/share_folders.rb:22:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/prepare_nfs_settings.rb:21:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/synced_folders.rb:90:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/delayed.rb:22:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/synced_folder_cleanup.rb:31:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/plugins/synced_folders/nfs/action_cleanup.rb:28:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/prepare_nfs_valid_ids.rb:14:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:117:in `block in finalize_action'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builder.rb:183:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:in `block in run'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/util/busy.rb:22:in `busy'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:in `run'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/call.rb:56:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:117:in `block in finalize_action'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builder.rb:183:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:in `block in run'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/util/busy.rb:22:in `busy'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:in `run'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/call.rb:56:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/create_network_interfaces.rb:169:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/create_networks.rb:98:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/create_domain.rb:466:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/resolve_disk_settings.rb:143:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/create_domain_volume.rb:98:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/handle_box_image.rb:129:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/handle_box.rb:59:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/handle_storage_pool.rb:63:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/set_name_of_domain.rb:34:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/provision.rb:83:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/cleanup_on_failure.rb:21:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:117:in `block in finalize_action'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builder.rb:183:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:in `block in run'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/util/busy.rb:22:in `busy'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:in `run'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/call.rb:56:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/box_check_outdated.rb:98:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/config_validate.rb:28:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builder.rb:183:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:in `block in run'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/util/busy.rb:22:in `busy'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:in `run'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/machine.rb:247:in `action_raw'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/machine.rb:216:in `block in action'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/environment.rb:649:in `lock'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/machine.rb:202:in `call'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/machine.rb:202:in `action'
win10-1  |      from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/batch_action.rb:89:in `block (2 levels) in run'
win10-1  |      from /opt/vagrant/embedded/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
win10-1 exited with code 1

I have tried using the uploaded image, Vagrant 2.4.1 and 2.4.3. All come back with the same error. I am aware of an issue with fog-libvirt 0.13.1, so perhaps we need to control the version of the ruby libraries?