Packer错误消息:找不到名为'packer-virtualbox-iso-的注册机器#

时间:2018-05-30 17:41:22

标签: windows virtualbox packer

目前我正在Windows 10上运行Packer。我正在尝试使用Packer来为VM进行自定义安装。

在我的JSON文件中,这是我的配置:

{
    "builders": [
      {
        "type": "virtualbox-iso",
        "vboxmanage": [
          [ "modifyvm", "{{.Name}}", "--cpus", "1" ],
          [ "modifyvm", "{{.Name}}", "--clipboard", "bidirectional" ],          
          [ "modifyvm", "{{.Name}}", "--memory", "2048" ],
          [ "modifyvm", "{{.Name}}", "--name", "{{ user `alias` }}" ],
          [ "modifyvm", "{{.Name}}", "--draganddrop", "bidirectional" ], 
          [ "modifyvm", "{{.Name}}", "--boot3", "disk" ], 
          [ "modifyvm", "{{.Name}}", "--audio", "none" ],  
          [ "modifyvm", "{{.Name}}", "--nic1", "intnet" ],  
          [ "modifyvm", "{{.Name}}", "--nic2", "null" ] 
        ],
        "guest_os_type": "Ubuntu_64",
        "iso_url": "{{ user `iso_url` }}",
        "iso_checksum": "{{ user `iso_checksum` }}",
        "iso_checksum_type": "md5",
        "disk_size": "{{ user `disk_size` }}",
        "ssh_username": "packer",
        "ssh_password": "packer",
        "guest_additions_mode": "attach",
        "headless": "{{ user `headless` }}", 
        "shutdown_command": "echo 'packer' | sudo -S shutdown -P now"
      }
    ],
    "variables": {
      "headless": "false",
      "iso_checksum": "{checksum number variable}",
      "iso_url": "file:///C:/{path to iso file}",
      "disk_size": "256000",
      "alias": "packervm"
    }
  }

但是,在尝试构建JSON文件时,我收到了这些错误 enter image description here

我如何解决它们?

1 个答案:

答案 0 :(得分:0)

请勿使用vboxmange配置来设置名称[“modifyvm”,“{{。Name}}”,“ - name”,“{{user alias}}”,而是使用vm_name改为配置。