PolySwarmPolySwarmPolySwarmPolySwarm
Help

(Legacy) Windows + VirtualBox

WARNING:

This documentation is DEPRECATED and IS NOT MAINTAINED. It will be removed in the future.

We strongly encourage all Windows developers to migrate to the newer, simpler and easier to test Windows + Docker instructions.

VirtualBox Guest 配置

If your computer is running Windows Server 2016 or Windows 10 Pro (version 1809+), we recommend you conduct Microengine development inside of a Windows Container

The recommendations presented here are hard-won. We strongly recommend that you test using the exact parameters presented here. Using any other configuration will make it difficult for us to provide you with support.


系统要求

使用 Window 系统开发引擎的需要微不足道的系统要求:

  • Windows 10 Pro
  • BIOS 中支持并启用 VT-x
  • 16GB 以上的 RAM
  • 4个以上的 CPU
  • 10GB 以上的磁盘空间

我们将使用 VirtualBox 。 **VirtualBox 必须拥有您的虚拟机管理程序(hypervisor)的唯一所有权 **。 这意味着您不能运行:

  • Hyper-V
  • Windows Credential Guard
  • Windows Device Guard
  • VMWare Workstation / Player
  • 任何使用 hypervisor 扩充的产品

先决条件

These instructions are tested against:

  • VirtualBox 6.0.6
  • Windows 10 1809 (17763.437)

Using older versions may work, but have not been tested and will not be supported.


Getting Started

Create a VirtualBox Windows Guest

使用 VirtualBox 来使用以下参数创建 Windows 虚拟机 (VM):

  • 名称:polyswarm_win
  • Type: Microsoft Windows
  • 版本:Windows 10(64 位)
  • RAM:4GB+
  • CPU:2+ 核
  • 视频内存:128MB
  • disk space: 50GB+

Use the default setting for all other options. 特别是,不启用 3D 加速

Install Windows 10

使用下载的 ISO,在 VM 中安装 Windows。

Install VirtualBox Guest Additions

Guest Additions 对于 Guest 和 Host 之间的共享剪贴板/复制及粘贴功能是必要的。

请参阅 VirtualBox 的使用手册

Configure Windows

We'll need to use Administrator privilege to make several changes to default Windows settings. 我们需要一个 “升级”/“有特权”的 PowerShell 控制台:

  • search "PowerShell" in the desktop search bar
  • right click on "Windows PowerShell"
  • select "Run as administrator".

在此特权 PowerShell 控制台中运行以下命令。

  1. Permit script execution (necessary for installing Chocolatey & using virtualenvs):

    Set-ExecutionPolicy Bypass -Scope LocalMachine -Force
  2. Force PowerShell to use TLSv2 (required of some dependencies):

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Install Chocolatey & Prerequisites

Chocolatey is a package manager for Windows. We'll use it to help with installing some prerequisites.

Run the following in a privileged PowerShell console.

  1. Install Chocolatey:

    iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  2. Use Chocolatey to install prerequisites (do these one at a time):

    choco install -y python --version 3.6.5
    choco install -y git
    choco install -y visualcpp-build-tools --version 14.0.25420.1

Disable Anti-Malware Products

We strongly recommend disabling all anti-malware products in your development environment - including the built-in Windows Defender. Below, we describe disabling Windows Defender. Disabling third party solutions is left as an exercise for the reader.

PolySwarm engines should expect to come into contact with malware. Existing anti-malware engines, including the built-in Windows Defender, can easily get in our way, quarantining or deleting files during development.

You can disable Windows Defender by installing a verified configuration package from chocolatey (make sure to do so in a privileged shell):

choco install disabledefender-winconfig

Afterwards, reboot Windows.

If you need to re-enable realtime protection at any point in the future, you can uninstall the package:

choco uninstall disabledefender-winconfig

Set up a Virtual Environment (virtualenv)

If you plan to use this Windows installation for other purposes, we recommend that you create a PolySwarm virtualenv so as to keep the system-wide Python packages clean:

cd ~
python -m venv polyswarmvenv
./polyswarmvenv/Scripts/Activate.ps1

Install polyswarm-client Libraries

If you're using a virtualenv (see above), ensure that you activate it before installing polyswarm-client.

Installing polyswarm-client requires installing two packages under Windows:

pip install -v -U git+https://github.com/polyswarm/ethash.git#egg=pyethash
pip install polyswarm-client

Verify Installation

You should now have a working development environment!

只需尝试导入 polyswarmclient 即可进行验证:

$ python
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import polyswarmclient
>>>

您应该能够毫无问题地导入 polyswarmclient

Next Steps

Now that we have a working development environment, we'll use participant-template to bootstrap our project.

Create Your Participant →