Parallels / vagrant-parallels

Vagrant Parallels Provider
https://parallels.github.io/vagrant-parallels
MIT License
994 stars 87 forks source link

Unknown interface vagrant-vnet0 #147

Closed silentroach closed 10 years ago

silentroach commented 10 years ago

Just recreated the box with destroy/up. It was ok and I halted it. And now I can't up it again :( Parallels Desktop 9 vagrant-parallels (1.3.0) vagrant 1.6.5

$ vagrant up
Bringing machine 'default' up with 'parallels' provider...
==> default: Checking if box 'parallels/ubuntu-14.04' is up to date...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 0: shared
    default: Adapter 1: hostonly
There was an error while command execution. The command and stderr is shown below.

Command: ["prlctl", "set", "c3fb2c18-0094-4c36-b708-ad6aa0d88570", "--device-set", "net1", "--enable", "--type", "bridged", "--iface", "vagrant-vnet0"]

Stderr: Unknown interface: vagrant-vnet0
Failed to configure the virtual machine.
$ prlctl list --info --full c3fb2c18-0094-4c36-b708-ad6aa0d88570
INFO
ID: {c3fb2c18-0094-4c36-b708-ad6aa0d88570}
Name: avito-vagrant_default_1412971710803_86782
Description:
Type: VM
State: stopped
OS: ubuntu
Uptime: 00:21:32 (since 2014-10-11 00:08:13)
Home: /Users/silent/Documents/Parallels/avito-vagrant_default_1412971710803_86782.pvm/
GuestTools: state=possibly_installed version=9.0.24251
Autostart: off
Autostop: suspend
Startup view: same
On gui shutdown: close
On window close: keep-running
Undo disks: off
Boot order: hdd0 cdrom0 net0 net1
EFI boot: off
Allow select boot device: off
External boot device:
Remote display: mode=off address=0.0.0.0
Remote display state: stopped
Hardware:
  cpu cpus=2 VT-x accl=high mode=32
  memory 512Mb
  video 32Mb    3d acceleration: highest
 vertical sync
  memory_quota auto
  hdd0 (+) sata:0 image='/Users/silent/Documents/Parallels/avito-vagrant_default_1412971710803_86782.pvm/harddisk.hdd' type='expanded' 40960Mb
  cdrom0 (+) sata:1 real='Default CD/DVD-ROM'
  usb (+)
  net0 (+) type=shared mac=001C427FD15D card=virtio preventpromisc=on mac_filter=on ip_filter=on nameservers= searchdomains=
  net1 (-) type=bridged iface='vnic2' mac=001C426D63F6 card=virtio preventpromisc=on mac_filter=on ip_filter=on nameservers= searchdomains=
  sound0 (+) output='Default' mixer='Default'
Host Shared Folders: (+)
SmartMount: (+)
  removable drives (+)
  CD/DVD drives (+)
  network shares (+)
Encrypted: no
Edit restricted: no
Protected: no
Smart mouse optimized for games: auto
Sticky mouse: off
Keyboard optimized for games: off
Automatic sharing cameras: off
Automatic sharing bluetooth: off
Support USB 3.0: on
Faster virtual machine: on
Adaptive hypervisor: off
Disabled Windows logo: on
Auto compress virtual disks: off
Nested virtualization: off
PMU virtualization: off
Longer battery life: off
Show battery status: on
Show Windows systray in Mac menu: on
Auto-switch to full screen: on
Disable aero: off
Hide minimized windows: off
Lock VM on suspend: off
Isolate VM from host: off
Smart guard: off
Smart guard: notify before creation snapshot: on
Smart guard: interval of period creating snapshots: 86400
Smart guard: maximum count of creating snapshots: 10
$ cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

plugin_list = [ ]

{
    'vagrant-omnibus' => ''
}.each { |plugin_name, plugin_version|
    unless Vagrant.has_plugin? plugin_name
        unless plugin_version.empty?
            plugin_version = " --plugin-version " + plugin_version
        end

        plugin_list.push plugin_name + plugin_version
    end
}

unless plugin_list.empty?
    puts "You need to install missed plugins:"
    puts

    plugin_list.each{ |plugin_name|
        puts "$ vagrant plugin install " + plugin_name
    }

    exit
end

# ========================================

VAGRANTFILE_API_VERSION = "2"
CURRENT_USER = `whoami`.chomp.downcase

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

    config.vm.box = "chef/ubuntu-14.04"
    config.vm.hostname = "avito-dev"

    config.vm.network "private_network", ip: "192.168.50.4"

    config.ssh.forward_agent = true

    recipes = [ ]

    # монтируем только то, что есть
    {
        # монтируем общую папку с проектами
        '/srv/all' => ['../'],

        '/srv/avito' => ['../avito', 'app::avito'],
        '/srv/avito-tests' => ['../avito-tests']
    }.each { |guestDir, info|
        if File.directory?(info[0])
            config.vm.synced_folder info[0], guestDir, owner: 'vagrant', group: 'vagrant'

            if info.length > 1
                recipes.push info[1]
            end
        end
    }

    # ========================================

    config.omnibus.chef_version = "11.12.4"

    # ========================================

    config.vm.provider :virtualbox do |vb, override|
        vb.customize ['modifyvm', :id, '--memory', '512']
        vb.customize ['modifyvm', :id, '--name', 'avito']
        vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
        vb.customize ['modifyvm', :id, '--cpus', 2]
        vb.customize ['modifyvm', :id, '--ioapic', 'on']
        vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
    end

    config.vm.provider :parallels do |parallels, override|
        override.vm.box = "parallels/ubuntu-14.04"

        parallels.update_guest_tools = true
        parallels.optimize_power_consumption = false

        parallels.memory = 512
        parallels.cpus = 2
    end

    # ========================================

    config.vm.provision :chef_solo do |chef|
        chef.custom_config_path = "Vagrantfile.chef"

        chef.json = {
            'ngrok' => {
                'whoami' => CURRENT_USER
            }
        }

        chef.log_level = :info
        chef.cookbooks_path = ['cookbooks', 'site-cookbooks', 'user-cookbooks']

        if 0 < recipes.length
            chef.add_recipe "apt-pre"
            # ===
            chef.add_recipe "apt"
            # ===
            chef.add_recipe "common"
            chef.add_recipe "nodejs"
            chef.add_recipe "php"
            # ===
            chef.add_recipe "app"
        end

        recipes.each do |recipe|
            chef.add_recipe recipe
        end

        # пользовательские настройки
        if File.directory?("user-cookbooks/user-" + CURRENT_USER)
            chef.add_recipe "user-" + CURRENT_USER
        end
    end

end
silentroach commented 10 years ago

Tried to remove network interfaces in vm GUI settings and got this:

vagrant up
==> default: Checking if box 'parallels/ubuntu-14.04' is up to date...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 0: shared
    default: Adapter 1: hostonly
There was an error while command execution. The command and stderr is shown below.

Command: ["prlctl", "set", "c3fb2c18-0094-4c36-b708-ad6aa0d88570", "--device-add", "net", "--type", "bridged", "--iface", "vagrant-vnet0"]

Stderr: Unknown interface: vagrant-vnet0
Failed to configure the virtual machine.
silentroach commented 10 years ago

Tried to recreate again:

destroy up - ok (with provision, as normal) ssh - ok halt - ok up - the same error

legal90 commented 10 years ago

@silentroach, thanks for reporting this issue!

I've just fixed it in v1.3.1

silentroach commented 10 years ago

Works fine now, thank you