Debian Wheezy的Vagrant Hyper-V提供商?

时间:2014-04-30 22:22:09

标签: debian vagrant hyper-v

我正试图让流浪的hyper-v提供程序使用debian 7.4映像,但没有太多运气。

  1. 我按照http://docs.vagrantup.com/v2/hyperv/boxes.html中的步骤创建了一个流浪盒。
  2. 我从hyper-v。
  3. 中删除了所有现有的hyper-v vms和网络交换机
  4. 我在hyper-v中添加了“外部开关”。
  5. 然后:

    [ADMIN] 17:55:06 C:\> cd .\vagrant-test
    [ADMIN] 17:55:08 C:\vagrant-test> ls
    [ADMIN] 17:55:08 C:\vagrant-test> vagrant init debian-wheezy
    A `Vagrantfile` has been placed in this directory. You are now
    ready to `vagrant up` your first virtual environment! Please read
    the comments in the Vagrantfile as well as documentation on
    `vagrantup.com` for more information on using Vagrant.
    [ADMIN] 17:55:19 C:\vagrant-test> vagrant up --provider=hyperv
    Bringing machine 'default' up with 'hyperv' provider...
    ==> default: Verifying Hyper-V is enabled...
    ==> default: Importing a Hyper-V instance
        default: Cloning virtual hard drive...
        default: Creating and registering the VM...
        default: Successfully imported a VM with name: DebianWheezy74Base
    ==> default: Starting the machine...
    ==> default: Waiting for the machine to report its IP address...
        default: Timeout: 120 seconds
    Hyper-V failed to determine your machine's IP address within the
    configured timeout. Please verify the machine properly booted and
    the network works. To do this, open the Hyper-V manager, find your
    virtual machine, and connect to it.
    
    The most common cause for this error is that the running virtual
    machine doesn't have the latest Hyper-V integration drivers. Please
    research for your operating system how to install these in order
    for the VM to properly communicate its IP address to Hyper-V.
    [ADMIN] 17:57:55 C:\vagrant-test>
    
  6. 我用内置开关试过了同样的事情。

    这很公平,因为hyper-v提供程序尝试查找IP地址的方式是通过这样的powershell命令:

    [ADMIN] 18:01:18 C:\code\autosetup> Get-VMNetworkAdapter -VMName DebianWheezy74Base
    Name            IsManagementOs VMName             SwitchName      MacAddress   Status                      IPAddresses
    ----            -------------- ------             ----------      ----------   ------                      -----------
    Network Adapter False          DebianWheezy74Base External Switch 00155D890119 {Degraded, ProtocolVersion} {}
    
    
    [ADMIN] 18:01:25 C:\code\autosetup> (Get-VMNetworkAdapter -VMName DebianWheezy74Base).IPAddresses
    [ADMIN] 18:01:36 C:\code\autosetup>
    

    因此无法确定实际分配给VM的IP地址。是的,VM实际上通过DHCP非常快速地获得IP。

    有许多事情表明需要在VM上升级hyper-v集成服务,但hyper-v并非“正式”支持debian,只是RHEL。微软提供的下载仅包括rpms。 Debian 已经具有适当的hyper-v优点。我看到hyper-v模块已加载:

    root@debian74base:/home/vagrant# lsmod | grep hv_
    hv_utils               12986  0
    hv_netvsc              18304  0
    hv_storvsc             17423  2
    hv_vmbus               32029  4 hid_hyperv,hv_storvsc,hv_netvsc,hv_utils
    scsi_mod              162269  5 libata,sr_mod,sg,hv_storvsc,sd_mod
    

    有没有人得到流浪汉+ hyper-v + debian才能工作?如果是这样,怎么样?

1 个答案:

答案 0 :(得分:1)

我能够通过构建/安装hv_kvp_daemon(来自https://github.com/v10networks/hv_kvp_daemon)来获得debian / hyper-v / vagrant组合工作

构建包:

apt-get install devscripts git
cd /tmp
git clone https://github.com/v10networks/hv_kvp_daemon
cd hv_kvp_daemon
debuild -i -us -uc -b
dpkg -i ../hv-userspace-daemons_0.2-1_amd64.deb

将其设置为在启动时运行:

update-rc.d hv-kvp-daemon defaults. 

Vagrant(和Hyper-V管理员)之后能够检测到IP。