File: README.md

package info (click to toggle)
golang-github-linuxkit-virtsock 0.0~git20170720.0.0416e3d-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 424 kB
  • ctags: 444
  • sloc: ansic: 1,435; makefile: 81; sh: 7
file content (68 lines) | stat: -rw-r--r-- 2,234 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Operating System Specific

## Windows

Under Windows, we assume Docker for Windows is installed since this ships with a suitably patched Linux kernel (though the tests can also be run to a Windows VM).  Currently, there is also the restriction that one can only connect from the host to the (Linux) VM.

Build a Linux container with the test program as shown below.

## Linux

After building the binary can be run from a suitably privileged
container:

    $ cat >Dockerfile <<EOF
    FROM alpine
    RUN apk update && apk add strace
    ADD sock_stress.linux /sock_stress
    ENTRYPOINT ["/sock_stress"]
    EOF
    $ docker build -t stress . && docker run -it --rm --net=host --privileged stress [...options...]

## MacOS

Under MacOS the default is to assume Hyperkit as configured by Docker
for Mac (since the path to the sockets and the names of the sockets
themselves differ).

To run against standalone Hyperkit the path to the sockets must be
specified when starting Hyperkit and must be passed to the option:

    macos$ ./sock_stress.darwin -s vsock -m hyperkit:/var/run/

(this assumes hyperkit was built without `PRI_ADDR_PREFIX` or
`CONNECT_SOCKET_NAME` set at build time and run with e.g. `-s
7,virtio-sock,guest_cid=3,path=/var/run`)

In Docker mode everything is implied to be as it is configured by
Docker for Mac. This is the default but can be given explicitly with:

    macos$ ./sock_stress.darwin -s vsock -m docker

# Specific OS Pairs

## Linux & Docker for Windows

Start the linux container with program in server mode:

    PS> docker run -it --rm --net=host --privileged stress -s hvsock

The start the client in a separate powershell window:

    PS> $vmId = (Get-VM MobyLinuxVM).Id
    PS> .\sock_stress.exe -c hvsock://$vmId
    

## Linux & Docker for Mac

When running as a client on the Linux side the correct address is cid
"2" (the host):

    linux$ docker run -it --rm --net=host --privileged stress -c vsock://2
    macos$ ./sock_stress.darwin -s vsock

When running as a client on the MacOS side the correct address is cid
is "3" (the guest, as configued by Docker for Mac):

    linux$ docker run -it --rm --net=host --privileged stress -s vsock
    macos$ ./sock_stress.darwin -c vsock://3