Help us understand the problem. What is going on with this article?

Vagrant+Parallels上でCentOSを動かす

More than 3 years have passed since last update.

vagrantでvirtualboxを使ってCentOSをsetupする例は多いが、providerにparallelsを使った情報(というよりVagrantfileの例)が少なかったのでメモ.
まぁ無料じゃないですしね…

バージョン情報

  • vagrant 1.7.4
  • Parallels 10.2.1
  • CentOS 7.1

参考URL

セットアップ

vagrant-parallesインストール

Vagrantでparallelsが使えるように、vagrant-parallesを追加する

$ vagrant plugin install vagrant-parallels

Vagrantfileを準備する

$ mkdir -p $HOME/vagrant/centos7.1
$ cd $HOME/vagrant/centos7.1
$ vi Vagrantfile

環境に合わせて設定する.

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.box = "parallels/centos-7.1"
  config.vm.network "forwarded_port", guest: 80, host: 8080
  config.vm.network "private_network", ip: "192.168.33.11"
  config.vm.synced_folder ".", "/data"

  config.vm.provider "parallels" do |v|
    v.name = "canvas"
    v.update_guest_tools = true # parallels toolsの自動updateを許可するか
    v.optimize_power_consumption = false # パフォーマンスかバッテリー優先か(デフォルトはfalse)
    v.customize [ "set", :id,
                  "--cpus", 4,
                  "--memsize", 1536,
                  "--autostart", "off",   # parallelsを起動させた時の挙動(デフォルトはoff)
                  "--autostop", "suspend" # parallelsを停止させた時の挙動を指定
                ]
  end
end

https://github.com/kegamin/dotfiles/blob/master/etc/vagrant/Vagrantfile.centos71.parallels

起動

vagrant upで起動させて完了
※ Vagrantfileで指定してるので--provider=parallesは無くてもOK

$ vagrant up
Bringing machine 'default' up with 'parallels' provider...
==> default: Checking if box 'parallels/centos-7.1' is up to date...
==> default: Setting the name of the VM: canvas
==> default: Preparing network interfaces based on configuration...
    default: Adapter 0: shared
    default: Adapter 1: hostonly
==> default: Clearing any previously set network interfaces...
==> default: Forwarding ports...
    default: 80 => 8080
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 10.211.55.6:22
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection refused. Retrying...
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for Parallels Tools installed on the VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /data => /Users/user/vagrant/centos7.1

Vagrantでできなかった設定

macの優先度をあげたかったけど、以下の設定に該当する部分がprtctlになかったのでVagrantfileで弄れなかった…。手で弄って最終的に変更したけどここはできないのかな?

スクリーンショット 2015-08-07 12.21.37.png

shivase
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした