qemus / qemu-docker

QEMU in a Docker container.
MIT License
387 stars 47 forks source link

[Question]: How do i connect into SSH and VNC? #576

Closed Vann-Dev closed 1 week ago

Vann-Dev commented 1 month ago

Is your question not already answered in the FAQ?

Is this a general question and not a technical issue?

Question

How do I connect to the SSH?, and how can I connect via VNC too?

services:
  qemu:
    image: qemux/qemu-docker
    environment:
      DISPLAY: "vnc"
      RAM_SIZE: "512M"
      DISK_SIZE: "1G"
      BOOT: "https://dl-cdn.alpinelinux.org/alpine/v3.9/releases/x86_64/alpine-virt-3.9.6-x86_64.iso"
    devices:
      - /dev/kvm
    cap_add:
      - NET_ADMIN
    ports:
      - 2204:22
      - 5900:5900
    stop_grace_period: 2m

if I remember that Vnc is on 5900 right?, I've read some of the issues created by other too https://github.com/qemus/qemu-docker/issues/573#issuecomment-2240634671

but when I access it it showed nothing on the web image

also how do I connect into the ssh?, since I got this image

Vann-Dev commented 1 month ago

Okay i managed to connect into ssh and qemu, using ubuntu iso, i think the problem was from the iso (idk so much about this)

Vann-Dev commented 1 month ago

But what's the password of the ssh?

NateChoe1 commented 1 month ago

You seem to be using a web browser to connect to port 5900. Instead, you need to use an actual VNC client, like Remmina. You could instead disable VNC and connect to port 8006 with this docker-compose file

services:
  qemu:
    image: qemux/qemu-docker
    environment:
      RAM_SIZE: "512M"
      DISK_SIZE: "1G"
      BOOT: "https://dl-cdn.alpinelinux.org/alpine/v3.9/releases/x86_64/alpine-virt-3.9.6-x86_64.iso"
    devices:
      - /dev/kvm
    cap_add:
      - NET_ADMIN
    ports:
      - 2204:22
      - 8006:8006
    stop_grace_period: 2m

Note that the DISPLAY environment variable has been removed and we're mapping port 8006 instead of 5900. Then, in your web browser, instead of connecting to http://localhost:5900, connect to http://localhost:8006