Giter VIP home page Giter VIP logo

wnbd's Introduction

Windows Network Block Device (WNBD)

Build Status:

Build status

What is WNBD?

WNBD is a client side implementation of Network Block Device

Prerequisites

Visual Studio 2019 build tools or GUI (Community version or above)

Windows Driver Kit 1909

Folders

  • Dockerfile contains a Dockerfile to create a Docker image that contains needed prerequisites

  • driver contains the driver sources

  • ksocket_wsk contains the WSK implementation needed to communicate with the Network Block Device server

  • userspace contains a simple console application wnbd-client useful for testing

  • vstudio contains the Visual Studio solution file and its projects

How to build

> git clone https://github.com/cloudbase/wnbd
> msbuild wnbd\vstudio\wnbd.sln
> copy wnbd\vstudio\x64\Debug\driver\* .
> copy wnbd\vstudio\x64\Debug\wnbd-client.exe .
  • You can download the latest prebuilt packages from Appveyor via the links:

How to install

  • Prerequisites.

    After building, the driver is automatically test signed. To install the built driver you must make sure that your target machine is Test Signed enabled first. To enable Test Signing on your target machine, please issue the following from an elevated command prompt:

    > bcdedit.exe /set testsigning yes
    

    Please note that you can enable driver signing only if Secure Boot is not enabled on the target machine. To check if your target machine does not have Secure Boot enabled issue Confirm-SecureBootUEFI from an elevated powershell prompt

    PS C:\WINDOWS\system32> Confirm-SecureBootUEFI
    False
    

    A reboot is required after changing bcdedit settings

  • Installation/removal.

    We require devcon.exe utility to install and uninstall the driver.

    • To install the driver issue the following from an elevated command prompt:
      > .\devcon.exe install .\wnbd.inf root\wnbd
      

    (The command above assumes that the utility devcon.exe and the driver files wnbd.inf, wnbd.cat, wnbd.sys are in the current directory)

    • To uninstall the driver issue the following from an elevated command prompt:
      .\devcon.exe remove "root\wnbd"
      

    (The command above assumes that the utility devcon.exe is in the current directory)

    For convenience, we included reinstall.ps1 which uninstalls (ignoring the error) and installs the driver again.

Testing with NBD (Network Block Device)

We assume you are familiar with using NBD.

  • wnbd-client syntax
PS C:\workspace> .\wnbd-client.exe
Syntax:
wnbd-client map  <InstanceName> <HostName> <PortName> <ExportName> <DoNotNegotiate>
wnbd-client unmap <InstanceName>
wnbd-client list
  • NBD server configuration:
root@ubuntu-Virtual-Machine:/home/ubuntu# cat /etc/nbd-server/config
[generic]
# If you want to run everything as root rather than the nbd user, you
# may either say "root" in the two following lines, or remove them
# altogether. Do not remove the [generic] section, however.
        port = 9000
        user = nbd
        group = nbd
        includedir = /etc/nbd-server/conf.d

# What follows are export definitions. You may create as much of them as
# you want, but the section header has to be unique.

[foo]
    exportname = /blaz/bla.img
    port = 9000
    copyonwrite = true
root@ubuntu-Virtual-Machine:/home/ubuntu# ifconfig eth0 | grep 172
        inet 172.17.160.251  netmask 255.255.255.240  broadcast 172.17.160.255
  • Mapping an export:
PS C:\workspace> .\wnbd-client.exe map test2 172.17.160.251 9000 foo
InstanceName=test2
HostName=172.17.160.251
PortName=9000
ExportName=foo
MustNegociate=1
PS C:\workspace> Get-Disk

Number Friendly Name            Serial Number   HealthStatus         OperationalStatus      Total Size Partition
                                                                                                      Style
------ -------------            -------------   ------------         -----------------      ---------- ----------
0      Msft Virtual Disk                        Healthy              Online                     127 GB GPT
1      WNBD Dis WNBD_DISK_ID    test2           Healthy              Online                     256 MB RAW
  • Listing the mapped device
PS C:\workspace> .\wnbd-client.exe list
Status: 0
InstanceName    Pid     DiskNumber
test2           6712            1
  • Unmapping the device
PS C:\workspace> .\wnbd-client.exe unmap test2
PS C:\workspace> Get-Disk

Number Friendly Name             Serial Number    HealthStatus         OperationalStatus      Total Size Partition
                                                                                                        Style
------ -------------             -------------    ------------         -----------------      ---------- ----------
0      Msft Virtual Disk                          Healthy              Online                     127 GB GPT

What other documentation is available?

Build via docker

wnbd's People

Contributors

alexpilotti avatar aserdean avatar petrutlucian94 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.