Skip to content
sewitiPublic

About

Virtual machine & Container detection in Go

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

virt

Go Reference

Package virt is a library that helps detect if application is running in a virtual machine, container or bare-metal.

It depends on klauspost/cpuid library for getting low-level CPU flags.

Detection mechanism is based on the checks in chuckleb/virt-what.

Install

go get -u github.com/sewiti/virt

Usage Example

package main

import (
	"fmt"

	"github.com/sewiti/virt"
)

func main() {
	fmt.Println("Virtual machine: ", virt.IsVM())
	fmt.Println("Container:       ", virt.IsContainer())
}

About

Virtual machine & Container detection in Go

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages