Issues with Parallels & Vagrant/Packer

231 views
Skip to first unread message

Brian Hall

unread,
Jul 28, 2014, 4:45:38 PM7/28/14
to packe...@googlegroups.com
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

Brian Hall

unread,
Jul 29, 2014, 2:30:30 PM7/29/14
to packe...@googlegroups.com
Hey folks,

I've managed to get parallels tools installed during a provision step of Packer, but when I vagrant up, vagrant still believes parallels tools is not installed.  The VM itself believes it is installed, however.

Also, originally it looked like eth2 was supposed to be eth0, but in fact, everything got pushed down one.  So eth1 should have been eth0, eth2 should have been eth1, and eth0 is completely wrong.

Again, any help appreciated.

Brian

Alvaro Miranda Aguilera

unread,
Jul 29, 2014, 9:51:04 PM7/29/14
to packe...@googlegroups.com

On Tue, Jul 29, 2014 at 8:45 AM, Brian Hall <brianha...@gmail.com> wrote:
/etc/udev/rules.d/70-persistent-net.rule


add a shell provisioner task to delete /etc/udev/rules.d/70-persistent-net.rules

rm /etc/udev/rules.d/70-persistent-net.rules

that will sort the network issue

the /etc/udev/rules.d/70-persistent-net.rule files get created on boot, so not needed on the box template

for the parallel tools, are you upgrading the kernel after the vm is installed?

if yes, you should have a reboot, and in a new boot install the parallel tools


Brian Hall

unread,
Jul 30, 2014, 12:57:55 PM7/30/14
to packe...@googlegroups.com
I'm not upgrading the kernel at all at present.  The interesting thing is vagrant never believes that the parallels tools are installed.  When I vagrant up --debug, I can look in the log spew and see the GuestTools status is "possibly_installed".  Parallels thinks its installed from the perspective of its menus... so I'm not sure what's going on there.
Reply all
Reply to author
Forward
0 new messages