GithubHelp home page GithubHelp logo

doytsujin / vsock Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mdlayher/vsock

0.0 1.0 0.0 140 KB

Package vsock provides access to Linux VM sockets (AF_VSOCK) for communication between a hypervisor and its virtual machines. MIT Licensed.

License: MIT License

Go 100.00%

vsock's Introduction

vsock builds.sr.ht status GoDoc Go Report Card

Package vsock provides access to Linux VM sockets (AF_VSOCK) for communication between a hypervisor and its virtual machines. MIT Licensed.

For more information about VM sockets, check out my blog about Linux VM sockets in Go.

Go version support

This package supports varying levels of functionality depending on the version of Go used during compilation. The Listener and Conn types produced by this package are backed by non-blocking I/O, in order to integrate with Go's runtime network poller in Go 1.11+. Additional functionality is available starting in Go 1.12+. The older Go 1.10 is only supported in a blocking-only mode.

A comprehensive list of functionality for supported Go versions can be found on package vsock's GoDoc page.

Stability

At this time, package vsock is in a pre-v1.0.0 state. Changes are being made which may impact the exported API of this package and others in its ecosystem.

If you depend on this package in your application, please use Go modules when building your application.

Requirements

To make use of VM sockets with QEMU and virtio-vsock, you must have:

  • a Linux hypervisor with kernel 4.8+
  • a Linux virtual machine on that hypervisor with kernel 4.8+
  • QEMU 2.8+ on the hypervisor, running the virtual machine

Before using VM sockets, following modules must be removed on hypervisor:

  • modprobe -r vmw_vsock_vmci_transport
  • modprobe -r vmw_vsock_virtio_transport_common
  • modprobe -r vsock

Once removed, vhost_vsock module needs to be enabled on hypervisor:

  • modprobe vhost_vsock

On VM, you have to enable vmw_vsock_virtio_transport module. This module should automatically load during boot when the vsock device is detected.

To utilize VM sockets, VM needs to be powered on with following -device flag:

  • -device vhost-vsock-pci,id=vhost-vsock-pci0,guest-cid=3

Check out the QEMU wiki page on virtio-vsock for more details. More detail on setting up this environment will be provided in the future.

Usage

To try out VM sockets and see an example of how they work, see cmd/vscp. This command shows usage of the vsock.ListenStream and vsock.DialStream APIs, and allows users to easily test VM sockets on their systems.

vsock's People

Contributors

mdlayher avatar monstermunchkin avatar mxpv avatar aybabtme avatar pmorjan avatar stgraber avatar xmudrii avatar stefanharh avatar tklauser avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.