In order to speed up my workflow, I want to serve .qcow2 images from within my lan.

Note: This is not a step by step guide, just my notes of how I put things together.


  1. get the code from google and build it
  2. set it up
  3. test it

1. get the code from google and build it

Code taken from:

package main

import (

var (
	path = flag.String("path", "/mnt/_cloud", "path to the folder to serve. Defaults to the current folder")
	port = flag.String("port", "80", "port to serve on. Defaults to 80")

func main() {

	dirname, err := filepath.Abs(*path)
	if err != nil {
		log.Fatalf("Could not get absolute path to directory: %s: %s", dirname, err.Error())

	log.Printf("Serving %s on port %s", dirname, *port)

	err = Serve(dirname, *port)
	if err != nil {
		log.Fatalf("Could not serve directory: %s: %s", dirname, err.Error())


func Serve(dirname string, port string) error {
	fs := http.FileServer(http.Dir(dirname))
	http.Handle("/", fs)

	return http.ListenAndServe(":"+port, nil)

2. set it up

Once you get the executable, next step is to create systemd unit, like simple_http.service:

Description=simple http


systemctl daemon-reload
systemctl start simple_http
systemctl status simple_http

3. test it

if everything is correct, you could try curl $(hostname). After that, just place your .qcow2 for local consumption.