containers/podman

qemu, $ podman machine start - Couldn't find KVM error, in Ubuntu

BuddhiLW opened this issue · 4 comments

Issue Description

Run:

podman machine start

Get:

Error: qemu exited unexpectedly with exit code 1, stderr: Could not access KVM kernel module: No such file or direct ory qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory

I have qemu-system-x86_64 installed, though.

Steps to reproduce the issue

Have sudo apt-get install podman podman-commons podman-toolbox podman-compose golang-gvisor-gvisor-dev golang-inet-netstack-dev runsc qemu-system qemu-system-x86

Steps to reproduce the issue

  1. Install podman.
  2. Install and move source gvisor 1 to /usr/libexec/podman/gvproxy
  3. podman machine init
  4. podman machine start

Get the error described.

Reference

Describe the results you received

Error: qemu exited unexpectedly with exit code 1, stderr: Could not access KVM kernel module: No such file or direct ory qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory

Describe the results you expected

Virtual machine to start.

podman info output

Client:       Podman Engine
Version:      4.3.1
API Version:  4.3.1
Go Version:   go1.20.2
Built:        Wed Dec 31 21:00:00 1969
OS/Arch:      linux/amd64
host:
  arch: amd64
  buildahVersion: 1.28.2
  cgroupControllers:
  - cpu
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon_2.1.6+ds1-1_amd64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.6, commit: unknown'
  cpuUtilization:
    idlePercent: 97.44
    systemPercent: 1.33
    userPercent: 1.23
  cpus: 12
  distribution:
    codename: lunar
    distribution: ubuntu
    version: "23.04"
  eventLogger: journald
  hostname: markov
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 6.2.0-24-generic
  linkmode: dynamic
  logDriver: journald
  memFree: 181477376
  memTotal: 16637362176
  networkBackend: netavark
  ociRuntime:
    name: runc
    package: runc_1.1.4-0ubuntu3.1_amd64
    path: /usr/sbin/runc
    version: |-
      runc version 1.1.4-0ubuntu3.1
      spec: 1.0.2-dev
      go: go1.20.3
      libseccomp: 2.5.4
  os: linux
  remoteSocket:
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,
CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /bin/slirp4netns
    package: Unknown
    version: |-
      slirp4netns version 1.2.0
      commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.4
  swapFree: 4285788160
  swapTotal: 4294963200
  uptime: 4h 29m 3.00s (Approximately 0.17 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/lw/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: vfs
  graphOptions: {}
  graphRoot: /home/lw/.local/share/containers/storage
  graphRootAllocated: 548275085312
  graphRootUsed: 201930133504
  graphStatus: {}
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 0
  runRoot: /run/user/1000/containers
  volumePath: /home/lw/.local/share/containers/storage/volumes
version:
  APIVersion: 4.3.1
  Built: 0
  BuiltTime: Wed Dec 31 21:00:00 1969
  GitCommit: ""
  GoVersion: go1.20.2
  Os: linux
  OsArch: linux/amd64
  Version: 4.3.1


### Podman in a container

No

### Privileged Or Rootless

Rootless

### Upstream Latest Release

Yes

### Additional environment details

_No response_

### Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

Thanks for reaching out, @BuddhiLW. That looks more like a packaging issue on Ubuntu, or am I misinterpreting the issue?

Luap99 commented

I am pretty sure you have to install qemu-kvm as we want proper hardware acceleration. Without that the emulation would be insanely slow AFAIK.

Is there a reason you try to run podman machine in the first place? You can run podman natively on linux without the overhead of the machine VM.

No particular one, just wanted to have exactly the same environment as a course I'm doing.

But, as I stumbled in this issue, and I didn't find any resources on it, I decided to report the issue.

You are correct, and currently I'm just using my own linux machine, straight up - running smoothly, may I add.

I will close it, because It doesn't make sense running the Linux VM inside Linux itself. But, I will test installing qemu-kvm. I don't know how I missed this package.