Skip to content

Commit

Permalink
Merge pull request #278 from legal90/parallels-improve
Browse files Browse the repository at this point in the history
Parallels: Support of FreeBSD and OmniOS. Some fixes
  • Loading branch information
juliandunn committed Oct 30, 2014
2 parents c1004c0 + f06c686 commit 6e060a9
Show file tree
Hide file tree
Showing 8 changed files with 276 additions and 1 deletion.
4 changes: 4 additions & 0 deletions builds/parallels/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
46 changes: 46 additions & 0 deletions packer/freebsd-10.0-amd64.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,57 @@
"numvcpus": "1",
"cpuid.coresPerSocket": "1"
}
},
{
"type": "parallels-iso",
"boot_command": [
"<esc><wait>",
"load geom_mbr<wait>",
"<enter><wait>",
"load zfs<wait>",
"<enter><wait>",
"boot -s<wait>",
"<enter><wait>",
"<wait10><wait10>",
"/bin/sh<enter><wait>",
"mdmfs -s 100m md1 /tmp<enter><wait>",
"mdmfs -s 100m md2 /mnt<enter><wait>",
"dhclient -l /tmp/dhclient.lease.em0 em0<enter><wait>",
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-10.0/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 10140,
"guest_os_type": "freebsd",
"http_directory": "http",
"iso_checksum": "9c377b4a4e63443c0b210080694de26133e6a276eddb07c7e00e1c9aebd84109",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/releases/amd64/amd64/ISO-IMAGES/10.0/FreeBSD-10.0-RELEASE-amd64-disc1.iso",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo 'shutdown -p now' > shutdown.sh; cat 'shutdown.sh' | su -",
"parallels_tools_mode": "disable",
"prlctl_version_file": ".prlctl_version",
"vm_name": "packer-freebsd-10.0-amd64",
"output_directory": "packer-freebsd-10.0-amd64-parallels",
"prlctl": [
[ "set", "{{.Name}}", "--memsize", "512" ],
[ "set", "{{.Name}}", "--cpus", "1" ],
[ "set", "{{.Name}}", "--device-set", "cdrom0", "--iface", "ide" ],
[ "set", "{{.Name}}", "--device-del", "fdd0" ],
[ "set", "{{.Name}}", "--device-del", "parallel0" ]
]
}
],
"post-processors": [
{
"output": "../builds/{{.Provider}}/opscode_freebsd-10.0_chef-{{user `chef_version`}}.box",
"override": {
"parallels": {
"vagrantfile_template": "vagrantfile_templates/parallels/freebsd.rb"
}
},
"type": "vagrant"
}
]
Expand Down
46 changes: 46 additions & 0 deletions packer/freebsd-10.0-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,57 @@
"numvcpus": "1",
"cpuid.coresPerSocket": "1"
}
},
{
"type": "parallels-iso",
"boot_command": [
"<esc><wait>",
"load geom_mbr<wait>",
"<enter><wait>",
"load zfs<wait>",
"<enter><wait>",
"boot -s<wait>",
"<enter><wait>",
"<wait10><wait10>",
"/bin/sh<enter><wait>",
"mdmfs -s 100m md1 /tmp<enter><wait>",
"mdmfs -s 100m md2 /mnt<enter><wait>",
"dhclient -l /tmp/dhclient.lease.em0 em0<enter><wait>",
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-10.0/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 10140,
"guest_os_type": "freebsd",
"http_directory": "http",
"iso_checksum": "2c09643b3f79c703e424c03408882369025cec655c24a6d81ee073081ee75ebc",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/releases/i386/i386/ISO-IMAGES/10.0/FreeBSD-10.0-RELEASE-i386-disc1.iso",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo 'shutdown -p now' > shutdown.sh; cat 'shutdown.sh' | su -",
"parallels_tools_mode": "disable",
"prlctl_version_file": ".prlctl_version",
"vm_name": "packer-freebsd-10.0-amd64",
"output_directory": "packer-freebsd-10.0-i386-parallels",
"prlctl": [
[ "set", "{{.Name}}", "--memsize", "512" ],
[ "set", "{{.Name}}", "--cpus", "1" ],
[ "set", "{{.Name}}", "--device-set", "cdrom0", "--iface", "ide" ],
[ "set", "{{.Name}}", "--device-del", "fdd0" ],
[ "set", "{{.Name}}", "--device-del", "parallel0" ]
]
}
],
"post-processors": [
{
"output": "../builds/{{.Provider}}/opscode_freebsd-10.0_chef-{{user `chef_version`}}.box",
"override": {
"parallels": {
"vagrantfile_template": "vagrantfile_templates/parallels/freebsd.rb"
}
},
"type": "vagrant"
}
]
Expand Down
46 changes: 46 additions & 0 deletions packer/freebsd-9.3-amd64.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,57 @@
"memsize": "512",
"numvcpus": "1"
}
},
{
"boot_command": [
"<esc><wait>",
"load geom_mbr<wait>",
"<enter><wait>",
"load zfs<wait>",
"<enter><wait>",
"boot -s<wait>",
"<enter><wait>",
"<wait10><wait10>",
"/bin/sh<enter><wait>",
"mdmfs -s 100m md1 /tmp<enter><wait>",
"mdmfs -s 100m md2 /mnt<enter><wait>",
"dhclient -l /tmp/dhclient.lease.em0 em0<enter><wait>",
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-9.3/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 10140,
"guest_os_type": "freebsd",
"http_directory": "http",
"iso_checksum": "5a3c82653d77bba7d7ded8bd7efbedc09d52cf4045d98ce52a82c9e0f8fa9b0e",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/releases/amd64/amd64/ISO-IMAGES/9.3/FreeBSD-9.3-RELEASE-amd64-disc1.iso",
"output_directory": "packer-freebsd-9.3-amd64-parallels",
"shutdown_command": "echo 'shutdown -p now' > shutdown.sh; cat 'shutdown.sh' | su -",
"parallels_tools_mode": "disable",
"prlctl": [
[ "set", "{{.Name}}", "--memsize", "512" ],
[ "set", "{{.Name}}", "--cpus", "1" ],
[ "set", "{{.Name}}", "--device-set", "cdrom0", "--iface", "ide" ],
[ "set", "{{.Name}}", "--device-del", "fdd0" ],
[ "set", "{{.Name}}", "--device-del", "parallel0" ]
],
"prlctl_version_file": ".prlctl_version",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
"ssh_wait_timeout": "10000s",
"type": "parallels-iso",
"vm_name": "packer-freebsd-9.3-amd64"
}
],
"post-processors": [
{
"output": "../builds/{{.Provider}}/opscode_freebsd-9.3_chef-{{user `chef_version`}}.box",
"override": {
"parallels": {
"vagrantfile_template": "vagrantfile_templates/parallels/freebsd.rb"
}
},
"type": "vagrant"
}
],
Expand Down
45 changes: 45 additions & 0 deletions packer/freebsd-9.3-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,56 @@
"memsize": "512",
"numvcpus": "1"
}
},
{
"boot_command": [
"<esc><wait>",
"load geom_mbr<wait>",
"<enter><wait>",
"load zfs<wait>",
"<enter><wait>",
"boot -s<wait>",
"<enter><wait>",
"<wait10><wait10>",
"/bin/sh<enter><wait>",
"mdmfs -s 100m md1 /tmp<enter><wait>",
"mdmfs -s 100m md2 /mnt<enter><wait>",
"dhclient -l /tmp/dhclient.lease.em0 em0<enter><wait>",
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-9.3/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 10140,
"http_directory": "http",
"iso_checksum": "cab6aad9c3d5ea6a3fb4059f808225c67f1edaea730c555a86a9707ac41ba75d",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/releases/i386/i386/ISO-IMAGES/9.3/FreeBSD-9.3-RELEASE-i386-disc1.iso",
"output_directory": "packer-freebsd-9.3-i386-parallels",
"prlctl": [
[ "set", "{{.Name}}", "--memsize", "512" ],
[ "set", "{{.Name}}", "--cpus", "1" ],
[ "set", "{{.Name}}", "--device-set", "cdrom0", "--iface", "ide" ],
[ "set", "{{.Name}}", "--device-del", "fdd0" ],
[ "set", "{{.Name}}", "--device-del", "parallel0" ]
],
"prlctl_version_file": ".prlctl_version",
"parallels_tools_mode": "disable",
"shutdown_command": "echo 'shutdown -p now' > shutdown.sh; cat 'shutdown.sh' | su -",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
"ssh_wait_timeout": "10000s",
"type": "parallels-iso",
"vm_name": "packer-freebsd-9.3-i386"
}
],
"post-processors": [
{
"output": "../builds/{{.Provider}}/opscode_freebsd-9.3-i386_chef-{{user `chef_version`}}.box",
"override": {
"parallels": {
"vagrantfile_template": "vagrantfile_templates/parallels/freebsd.rb"
}
},
"type": "vagrant"
}
],
Expand Down
58 changes: 57 additions & 1 deletion packer/omnios-r151010j.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,69 @@
"memsize": "1024",
"numvcpus": "1"
}
},
{
"boot_command": [
"<enter><wait10><wait5>",
"1<enter><wait10>",
"<wait10>",
"<f2><wait10>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"<f2><wait>",
"<f2><wait>",
"<bs><bs><bs><bs><bs><bs><bs>omnios-vagrant",
"<f2><wait>",
"<f2><wait>",
"<f2><wait>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"<f8><wait>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"root<enter><wait><enter><wait5>",
"passwd<enter><wait>",
"vagrant<enter><wait>",
"vagrant<enter><wait>",
"ipadm create-if e1000g0<enter><wait>",
"ipadm create-addr -T dhcp e1000g0/v4<enter><wait>",
"echo 'nameserver 8.8.8.8' > /etc/resolv.conf<enter><wait>",
"cp /etc/nsswitch.dns /etc/nsswitch.conf<enter><wait>",
"sed -i -e 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config<enter><wait>",
"svcadm restart ssh<enter><wait>"
],
"boot_wait": "30s",
"disk_size": 40960,
"hard_drive_interface": "ide",
"guest_os_type": "opensolaris",
"iso_checksum": "bc3f4c0d29a5da75174de62da00294e5ef826b5e",
"iso_checksum_type": "sha1",
"iso_url": "{{user `mirror`}}/OmniOS_Text_r151010j.iso",
"output_directory": "packer-omnios-r151010j-parallels",
"shutdown_command": "/usr/sbin/shutdown -g 0 -y -i 5",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "root",
"parallels_tools_mode": "disable",
"type": "parallels-iso",
"vm_name": "packer-omnios-r151010j",
"prlctl": [
[ "set", "{{.Name}}", "--memsize", "512" ],
[ "set", "{{.Name}}", "--cpus", "1" ]
]
}
],
"post-processors": [
{
"compression_level": 9,
"output": "../builds/{{.Provider}}/opscode_omnios-r151010j_chef-{{user `chef_version`}}.box",
"override": {
"parallels": {
"vagrantfile_template": "vagrantfile_templates/parallels/omnios.rb"
}
},
"type": "vagrant"
}
],
Expand All @@ -141,4 +198,3 @@
"mirror": "http://omnios.omniti.com/media"
}
}

17 changes: 17 additions & 0 deletions packer/vagrantfile_templates/parallels/freebsd.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- mode: ruby -*-
# # vi: set ft=ruby :

Vagrant.require_version ">= 1.1.0"

Vagrant.configure("2") do |config|
config.ssh.shell = "sh"

# Disable the base shared folder, Guest Tools are unavailable.
config.vm.synced_folder ".", "/vagrant", disabled: true

config.vm.provider :parallels do |prl|
# Guest Tools are unavailable.
prl.check_guest_tools = false
prl.functional_psf = false
end
end
15 changes: 15 additions & 0 deletions packer/vagrantfile_templates/parallels/omnios.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- mode: ruby -*-
# # vi: set ft=ruby :

Vagrant.require_version ">= 1.1.0"

Vagrant.configure("2") do |config|
# Disable the base shared folder, Guest Tools are unavailable.
config.vm.synced_folder ".", "/vagrant", disabled: true

config.vm.provider :parallels do |prl|
# Guest Tools are unavailable.
prl.check_guest_tools = false
prl.functional_psf = false
end
end

0 comments on commit 6e060a9

Please sign in to comment.