Hey folks,
I've been working on a Box I've been building in Packer for Parallels. It uses the parallels-iso packer configuration, using Ubuntu 12.04.3 LTS. Pretty straightforward configuration, nothing fancy.
Relevant Section of Vagrant File:
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = $chef_env
config.ssh.username = "root"
config.vm.provider :parallels do |pl|
pl.memory = $vm_memory
pl.cpus = $vm_cpus
pl.optimize_power_consumption = false
end
config.vm.network "private_network", ip: "192.168.57.3"
# Synced folders, etc below...
end
Relevant Section of Packer Config:
{
"type": "parallels-iso",
"guest_os_type": "linux",
"guest_os_distribution": "ubuntu",
"iso_checksum": "2cbe868812a871242cdcdd8f2fd6feb9",
"iso_checksum_type": "md5",
"headless": "{{user `run_headless`}}",
"http_directory": "preseed",
"ssh_username": "{{user `username`}}",
"ssh_password": "{{user `password`}}",
"boot_wait": "5s",
"output_directory": "{{user `chef_env`}}_headless_basebox",
"shutdown_command": "echo 'shutdown -P now' > shutdown.sh; echo '{{user `password`}}'| sudo -S sh 'shutdown.sh'",
"parallels_tools_host_path": "/Applications/Parallels Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso",
"parallels_tools_mode": "upload",
"parallels_tools_guest_path": "../isos/prl-tools-lin.iso",
"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic ",
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"passwd/user-fullname={{user `username`}} ",
"passwd/username={{user `username`}} ",
"passwd/user-password={{user `password`}} ",
"passwd/user-password-again={{user `password`}} ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname={{ .Name }} ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
"keyboard-configuration/variant=USA console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- <enter>"
]
}
I'm having an issue with network configuration that I think might be Parallels Tools related, or I want to at least rule it out.
The VM at packer time has access to the internet and is able to pull down some packages during provisioning and build the box out. In Vagrant, I'm setting up 2 NICs, the default one, and a host only one. The issue is during "vagrant up", the mac address for eth0 device in the VM is changing from what is in /etc/udev/rules.d/70-persistent-net.rules. As a result, a third NIC is added, and so I end up with an eth0, eth1, and eth2 where eth2 is what eth0 was supposed to be. This makes vagrant unable to communicate with the VM at all. If I go into file and delete the old eth0 and rename the eth2 to eth0, everything works again.
My thought is that because my current packer configuration doesn't install parallels tools at packer provision time and have it baked into the box, that it doesn't fix up the mac addresses properly or something. So I'm trying to install parallels tools, but am not 100% sure how I go about it once its copied over. Is this a step I can get the provisioner to perform or do I have to mount it manually and install via SSH? Are there any examples of this actually working?
If its not Parallels Tools, I'm not entirely sure what does the mac address fixup between an exported box and parallels.
Any help would be greatly appreciated.
Brian