我正在使用基础图像(.vmx
格式(作为源构建一个.ova
文件。
使用vmware-iso
构建器从Ubuntu 16.04
服务器构建基础图像(如上所述以.vmx
格式创建(。
这是我的builder
配置
"builders": [
{
"type": "vmware-vmx",
"vmx_data": {
"memsize": "8192",
"numvcpus": "4"
},
"source_path": "path/to/base.vmx",
将运行的第一个提供程序如下:
"provisioners": [
{
"type": "shell",
"inline": [
"sudo apt-get update -y",
"sudo apt-get upgrade -y",
...
然而,尽管我已经重复了很多次这个过程,但它突然出现了以下错误:
==> vmware-vmx: Cloning source VM...
==> vmware-vmx: Starting HTTP server on port 8031
==> vmware-vmx: Starting virtual machine...
==> vmware-vmx: Waiting 10s for boot...
==> vmware-vmx: Connecting to VM via VNC (127.0.0.1:5924)
==> vmware-vmx: Typing the boot command over VNC...
==> vmware-vmx: Waiting for SSH to become available...
==> vmware-vmx: Connected to SSH!
==> vmware-vmx: Provisioning with shell script: /tmp/packer-shell747369685
vmware-vmx: Reading package lists...
vmware-vmx: E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
vmware-vmx: E: Unable to lock directory /var/lib/apt/lists/
==> vmware-vmx: Stopping virtual machine...
==> vmware-vmx: Deleting output directory...
Build 'vmware-vmx' errored: Script exited with non-zero exit status: 100
请参阅无法锁定管理目录(/var/lib/dpkg/(是另一个进程在使用它吗?
apt进程运行时会放置锁,进程完成时会移除锁。如果有一个没有明显进程运行的锁,这可能意味着进程由于某种原因被卡住了。