Git Product home page Git Product logo

virtsock's Introduction

This repository contains Go bindings and sample code for Hyper-V sockets and virtio sockets(VSOCK).

Organisation

  • pkg/hvsock: Go binding for Hyper-V sockets
  • pkg/vsock: Go binding for virtio VSOCK
  • cmd/sock_stress: A stress test program for virtsock
  • cmd/vsudd: A unix domain socket to virtsock proxy (used in Docker for Mac/Windows)
  • scripts: Miscellaneous scripts
  • c: Sample C code (including benchmarks and stress tests)
  • data: Data from benchmarks

Building

By default the Go sample code is build in a container. Simply type make.

If you want to build binaries on a local system use make build-binaries.

Testing

There are several examples and tests written both in Go and in C. The C code is Hyper-V sockets specific while the Go code also works with virtio sockets and HyperKit. The respective READMEs contain instructions on how to run the tests, but the simplest way is to use LinuxKit.

Assuming you have LinuxKit installed, the make target make linuxkit will build a custom Linux image which can be booted on HyperKit or on Windows. The custom Linux image contains the test binaries.

macOS

Boot the Linux VM:

linuxkit run hvtest

This should create a directory called ./hvtest-state.

Run the server in the VM and client on the host:

linux$ sock_stress -s vsock -v 1
macos$ ./bin/sock_stress.darwin -c vsock://3 -m hyperkit:./hvtest-state -v 1

Run the server on the host and the client inside the VM:

macos$ ./bin/sock_stress.darwin -s vsock -m hyperkit:./hvtest-state -v 1
linux$ sock_stress -c vsock://2 -v 1

Windows

TBD

Known limitations

  • hvsock: The Windows side does not implement accept() due to limitations on some Windows builds where a VM can not connect to the host via Hyper-V sockets.

  • vsock: There is general host side implementation as the interface is hypervisor specific. The vsock package includes some support for connecting with the VSOCK implementation in Hyperkit, but there is no implementation for, e.g. qemu.

virtsock's People

Contributors

rn avatar justincormack avatar magnuss avatar jstarks avatar riyazdf avatar ebriney avatar beweedon avatar djs55 avatar simonferquel 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.