title: how to run linux kvm qcow2 image file in docker
body: <p><strong>background</strong></p>
  <p>My learning objective is to set up an <code>aws s3 gateway server</code> <strong>locally on my raspberry pi</strong> for <code>kubernetes</code> to connect to <code>s3</code> via <code>nfs</code>. aws has also provided some instructions on <code>gateway server</code> creation. (source: <a href="https://docs.aws.amazon.com/filegateway/latest/files3/use-nfs-csi.html" rel="nofollow noreferrer">aws nfs csi</a>, <a href="https://aws.amazon.com/blogs/storage/deploying-aws-storage-gateway-on-linux-kvm-hypervisor/" rel="nofollow noreferrer">gateway creation</a>).</p>
  <p><strong>problem</strong></p>
  <p>what I am unsure of, is how to set up the gateway server in <code>kubernetes</code>. So for starters, I'm trying to build a docker image that could launch the <code>linux kvm qcow2</code> image that they have provided. but this is where i am failing.</p>
  <p><strong>what i've tried to do so far</strong></p>
  <p><code>dockerfile</code></p>
  <pre><code>FROM ubuntu:latest
  
  COPY ./aws-storage-gateway-ID_NUMBER /
  
  RUN apt-get update &amp;&amp; apt-get upgrade -y &amp;&amp;\
      apt-get install qemu qemu-kvm libvirt-clients libvirt-daemon-system virtinst bridge-utils -y
  </code></pre>
  <p>within this docker image, i tried to follow the instructions in <code>gateway creation</code> but i'm met with this error from <code>virsh</code></p>
  <pre><code>root@ac48abdfc902:/# virsh version
  Authorization not available. Check if polkit service is running or see debug message for more information.
  error: failed to connect to the hypervisor
  error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
  </code></pre>
  <p>true enough, <code>/var/run/libvirt/libvirt-sock</code> does not exist. but I am stuck and can't find any useful information to resolve this error to get <code>virsh</code> running.</p>
  <p>any thoughts and ideas would be appreciated.</p>