レンタルサーバー・自宅サーバー設定・構築のヒント
レンタルサーバー・自宅サーバー設定・構築のヒント - レンタルサーバー・自宅サーバーの設定・構築情報を公開しています。

C5 C6 S6

VMWareにてインストールした CentOS/Scientific Linux に vmware-tools をインストールする

2011年10月28日 2017年8月10日
vmware tools

今回は、VMWareにてインストールした CentOS/Scientific Linux に VMware Tools をインストールしてみます。
VMWareにてインストールした Windows系のOSであれば、単純にインストーラからインストールすればOKです。
Linux系OSでは、Perlスクリプトで記述されたインストーラ(CUI)を使ってインストールすることになります。
Linux系OSの場合、VMware Playerが古すぎる(2.5以下)場合、どうしてもコンパイルエラーが発生して、自前でそのエラーを取り除かないといけなくなります。 そのため、VMware Playerは、少なくとも 3.0 以上を利用されることを、強くおすすめします。


VMware Playerは、 http://www.vmware.com/jp/products/desktop_virtualization/player/から、無料でダウンロードできます。

ここでは、VMware Player 4.0 を利用した解説を行います。

VMware Tools をインストールする

VMware Tools がインストールされていない場合、VMware Playerを起動した際、以下のような画面が表示されます。
VMware Tools ダウンロード要求

この画面から、以降、簡単に解説します。

  1. 画面下の[ ツールのインストール ]ボタンをクリックしてVMware Toolsの最新版をダウンロードします。

    (既に最新版がダウンロードされている場合は、ダウンロードの処理はなく、以下のダウンロード完了画面がすぐに表示されます。)
    最新版のダウンロードが完了すると以下の画面表示に切り替わります。
    VMware Tools ダウンロード完了
    この画面が表示されたときには、既にダウンロードが完了し、ダウンロードしたISOファイルをCD-ROMに接続した状態になっています。

    ダウンロード先は、VMware Playerのインストール先になります。
    例)以下は、HOST OS がWinodwsの場合です。
    C:\Program Files\VMware\VMware Player\linux.iso

  2. CD-ROM ( ISOファイル ) をマウントします。
    $ cd /mnt/return
    [mnt]$ mkdir cdromreturn
    [mnt]$ mount /dev/cdrom /mnt/cdromreturn
    mount: ブロックデバイス /dev/cdrom は書き込み禁止です、読込み専用でマウントします
    [mnt]$ ls cdrom/return
    VMwareTools-8.8.0-471268.tar.gz  manifest.txt
    

    これでlinux.isoの中身を確認できたはずです。


  3. VMwareTools の圧縮ファイルを適当なディレクトリへコピーします。
    [mnt]$ cp cdrom/VMwareTools-8.8.0-471268.tar.gz ~hoge/.return
    

  4. VMwareTools の圧縮ファイルを適当なディレクトリで解凍します。
    [mnt]$ cd ~hoge/return
    [hoge]$ tar xvfz VMwareTools-8.8.0-471268.tar.gzreturn
    ...
    [hoge]$
    

  5. VMwareTools を vmware-install.pl を使ってインスールします。

    CentOS 5

    [hoge]$ lsreturn
    VMwareTools-8.8.0-471268.tar.gz  vmware-tools-distrib
    [hoge]$ cd vmware-tools-distrib/return
    [vmware-tools-distrib]$ lsreturn
    FILES  INSTALL  bin  doc  etc  installer  lib  vmware-install.pl
    [vmware-tools-distrib]$ ./vmware-install.plreturn
    Creating a new VMware Tools installer database using the tar4 format.
    
    Installing VMware Tools.
    
    In which directory do you want to install the binary files?
    [/usr/bin] return
    
    What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
    [/etc/rc.d] return
    
    What is the directory that contains the init scripts?
    [/etc/rc.d/init.d] return
    
    In which directory do you want to install the daemon files?
    [/usr/sbin] return
    
    In which directory do you want to install the library files?
    [/usr/lib/vmware-tools] return
    
    The path "/usr/lib/vmware-tools" does not exist currently. This program is
    going to create it, including needed parent directories. Is this what you want?
    [yes] return
    
    In which directory do you want to install the documentation files?
    [/usr/share/doc/vmware-tools] return
    
    The path "/usr/share/doc/vmware-tools" does not exist currently. This program
    is going to create it, including needed parent directories. Is this what you
    want? [yes] return
    
    The installation of VMware Tools 8.8.0 build-471268 for Linux completed
    successfully. You can decide to remove this software from your system at any
    time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
    
    Before running VMware Tools for the first time, you need to configure it by
    invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
    this program to invoke the command for you now? [yes] return
    
    Initializing...
    
    
    Making sure services for VMware Tools are stopped.
    
    Stopping VMware Tools services in the virtual machine:
       Guest operating system daemon:                          [  OK  ]
       Virtual Printing daemon:                                [  OK  ]
       Unmounting HGFS shares:                                 [  OK  ]
       Guest filesystem driver:                                [  OK  ]
    
    
    [EXPERIMENTAL] The VMware FileSystem Sync Driver (vmsync) is a new feature that
    creates backups of virtual machines. Please refer to the VMware Knowledge Base
    for more details on this capability. Do you wish to enable this feature?
    [no] return
    
    Found a compatible pre-built module for vmci.  Installing it...
    
    
    Found a compatible pre-built module for vsock.  Installing it...
    
    
    Found a compatible pre-built module for vmxnet3.  Installing it...
    
    
    Found a compatible pre-built module for pvscsi.  Installing it...
    
    
    Found a compatible pre-built module for vmmemctl.  Installing it...
    
    
    The VMware Host-Guest Filesystem allows for shared folders between the host OS
    and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
    to enable this feature? [yes] return
    
    Found a compatible pre-built module for vmhgfs.  Installing it...
    
    
    Found a compatible pre-built module for vmxnet.  Installing it...
    
    
    Found a compatible pre-built module for vmblock.  Installing it...
    
    
    !!! [EXPERIMENTAL] !!!
    VMware automatic kernel modules enables automatic building and installation of
    VMware kernel modules at boot they are not already present.  By selecting yes,
    you will be enabling this experimental feature.  You can always disable this
    feature by re-running vmware-config-tools.pl.
    
    Would you like to enable VMware automatic kernel modules?
    [no] return
    
    ## 以下は、GUI関連の設定になります。
    
    Detected X version 7.1
    
    
    Host resolution detected as "1600 x 1200".
    
    
    Please choose one of the following display sizes that X will start with:
    
    [1]  "320x200"
    [2]  "320x240"
    [3]  "400x300"
    [4]  "512x384"
    [5]  "640x400"
    [6]  "640x480"
    [7]  "720x480"
    [8]  "800x480"
    [9]  "854x480"
    [10]  "720x576"
    [11]  "800x600"
    [12]  "1024x768"
    [13]  "1280x720"
    [14]  "1280x768"
    [15]  "1152x864"
    [16]  "1280x800"
    [17]  "1366x768"
    [18]  "1280x960"
    [19]  "1440x900"
    [20]  "1280x1024"
    [21]< "1400x1050"
    Please enter a number between 1 and 21:
    
    [21] 12return
    
    
    X is running fine with the new config file.
    
    no record for 'sda' in database
    /usr/bin/udevinfo: option requires an argument -- p
    Usage: udevinfo [-anpqrVh]
      -q TYPE  query database for the specified value:
                 'name'    name of device node
                 'symlink' pointing to node
                 'path'    sysfs device path
                 'env'     the device related imported environment
                 'all'     all values
    
      -p PATH  sysfs device path used for query or chain
      -n NAME  node/symlink name used for query
    
      -r       prepend to query result or print udev_root
      -a       print all SYSFS_attributes along the device chain
      -e       export the content of the udev database
      -V       print udev version
      -h       print this help text
    
    Creating a new initrd boot image for the kernel.
    Starting VMware Tools services in the virtual machine:
       Switching to guest configuration:                       [  OK  ]
       Paravirtual SCSI module:                                [  OK  ]
       Guest memory manager:                                   [  OK  ]
       Guest vmxnet fast network device:                       [  OK  ]
       VM communication interface:                             [  OK  ]
       VM communication interface socket family:               [  OK  ]
       Guest filesystem driver:                                [  OK  ]
       Mounting HGFS shares:                                   [  OK  ]
       Blocking file system:                                   [  OK  ]
       Guest operating system daemon:                          [  OK  ]
       Virtual Printing daemon:                                [  OK  ]
    The configuration of VMware Tools 8.8.0 build-471268 for Linux for this running
    kernel completed successfully.
    
    You must restart your X session before any mouse or graphics changes take
    effect.
    
    You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
    command line or by invoking "/usr/bin/vmware-toolbox" from the command line
    during an X server session.
    
    To enable advanced X features (e.g., guest resolution fit, drag and drop, and
    file and text copy/paste), you will need to do one (or more) of the following:
    1. Manually start /usr/bin/vmware-user
    2. Log out and log back into your desktop session; and,
    3. Restart your X session.
    
    To use the vmxnet driver, restart networking using the following commands:
    /etc/init.d/network stop
    rmmod pcnet32
    rmmod vmxnet
    modprobe vmxnet
    /etc/init.d/network start
    
    Enjoy,
    
    --the VMware team
    
    Found VMware Tools CDROM mounted at /mnt/cdrom. Ejecting device /dev/cdrom ...
    
    [vmware-tools-distrib]$
    

    上記の中のこの文字色は、タイプ(入力)した箇所になります。
    上記の中のこの文字色は、確認事項になります。
    確認事項については、ほとんどが括弧内に表示されているデフォルトのままでOKなので改行で、作業を進めます。 問題となるとしたら、画面の解像度ぐらいだと思います。ここでは、解像度”1024×768″を指定しています。自身の環境に合わせて各確認事項に応えていきましょう。


    CentOS 6   Scientific Linux 6

    [hoge]$ lsreturn
    VMwareTools-8.8.0-471268.tar.gz  vmware-tools-distrib
    [hoge]$ cd vmware-tools-distrib/return
    [vmware-tools-distrib]$ lsreturn
    FILES  INSTALL  bin  doc  etc  installer  lib  vmware-install.pl
    [vmware-tools-distrib]$ ./vmware-install.plreturn
    
    Installing VMware Tools.
    
    In which directory do you want to install the binary files?
    [/usr/bin] return
    
    What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
    [/etc/rc.d] return
    
    What is the directory that contains the init scripts?
    [/etc/rc.d/init.d] return
    
    In which directory do you want to install the daemon files?
    [/usr/sbin] return
    
    In which directory do you want to install the library files?
    [/usr/lib/vmware-tools] return
    
    In which directory do you want to install the documentation files?
    [/usr/share/doc/vmware-tools] return
    
    The path "/usr/share/doc/vmware-tools" does not exist currently. This program
    is going to create it, including needed parent directories. Is this what you
    want? [yes] return
    
    The installation of VMware Tools 8.8.0 build-471268 for Linux completed
    successfully. You can decide to remove this software from your system at any
    time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
    
    Before running VMware Tools for the first time, you need to configure it by
    invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
    this program to invoke the command for you now? [yes] return
    
    Initializing...
    
    
    Making sure services for VMware Tools are stopped.
    
    
    
    [EXPERIMENTAL] The VMware FileSystem Sync Driver (vmsync) is a new feature that
    creates backups of virtual machines. Please refer to the VMware Knowledge Base
    for more details on this capability. Do you wish to enable this feature?
    [no] return
    
    Found a compatible pre-built module for vmci.  Installing it...
    
    
    Found a compatible pre-built module for vsock.  Installing it...
    
    
    The module vmxnet3 has already been installed on this system by another
    installer or package and will not be modified by this installer.  Use the flag
    --clobber-kernel-modules=vmxnet3 to override.
    
    The module pvscsi has already been installed on this system by another
    installer or package and will not be modified by this installer.  Use the flag
    --clobber-kernel-modules=pvscsi to override.
    
    The module vmmemctl has already been installed on this system by another
    installer or package and will not be modified by this installer.  Use the flag
    --clobber-kernel-modules=vmmemctl to override.
    
    The VMware Host-Guest Filesystem allows for shared folders between the host OS
    and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
    to enable this feature? [yes] return
    
    Found a compatible pre-built module for vmhgfs.  Installing it...
    
    
    Found a compatible pre-built module for vmxnet.  Installing it...
    
    
    Found a compatible pre-built module for vmblock.  Installing it...
    
    
    !!! [EXPERIMENTAL] !!!
    VMware automatic kernel modules enables automatic building and installation of
    VMware kernel modules at boot they are not already present.  By selecting yes,
    you will be enabling this experimental feature.  You can always disable this
    feature by re-running vmware-config-tools.pl.
    
    Would you like to enable VMware automatic kernel modules?
    [no] return
    
    No X install found.
    
    Creating a new initrd boot image for the kernel.
    vmware-tools start/running
    The configuration of VMware Tools 8.8.0 build-471268 for Linux for this running
    kernel completed successfully.
    
    You must restart your X session before any mouse or graphics changes take
    effect.
    
    You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
    command line or by invoking "/usr/bin/vmware-toolbox" from the command line
    during an X server session.
    
    To enable advanced X features (e.g., guest resolution fit, drag and drop, and
    file and text copy/paste), you will need to do one (or more) of the following:
    1. Manually start /usr/bin/vmware-user
    2. Log out and log back into your desktop session; and,
    3. Restart your X session.
    
    To use the vmxnet driver, restart networking using the following commands:
    /etc/init.d/network stop
    rmmod pcnet32
    rmmod vmxnet
    modprobe vmxnet
    /etc/init.d/network start
    
    Enjoy,
    
    --the VMware team
    
    [vmware-tools-distrib]$
    

    上記の中のこの文字色は、タイプ(入力)した箇所になります。
    上記の中のこの文字色は、確認事項になります。
    確認事項については、ほとんどが括弧内に表示されているデフォルトのままでOKなので改行で、作業を進めます。


  6. 再起動します。
    $ rebootreturn
    	
    

  7. 立ち上がったら、VMwareToolsを起動します。

    CentOS 5

    $ /etc/init.d/vmware-tools startreturn
    $ /etc/init.d/vmware-tools statusreturn
    vmtoolsd is running
    $ chkconfig vmware-tools onreturn
    $ chkconfig --list vmware-toolsreturn
    vmware-tools    0:off   1:off   2:on    3:on    4:on    5:on    6:off
    $
    	
    

    ここの最後に設定しているように、chkconfigで必ず再起動でも自動的にサービス開始となるように設定します。


    CentOS 6  Scientifix Linux 6

    $ start vmware-toolsreturn
    $ status vmware-toolsreturn
    vmtoolsd is running
    $
    	
    

    CentOS 6 / Scientifix Linux 6 では、通常のデーモンでなく Upstart が使われてます。
    そのため、start / stop / status コマンドを用いて制御します。
    rebootするとデフォルトで起動しますから、先のrebootを実行した際は、上記のstartコマンドは不要のはずです。
    また、chkconfigも必要ありません。

    どうしても再起動などで自動で起動したくない場合は、以下のファイル( /etc/init/vmware-tools.conf )を編集します。
    ##########################################################################
    # Copyright 2010 VMware, Inc.  All rights reserved. -- VMware Confidential
    ##########################################################################
    
    ##########################################################################
    # DO NOT modify this file directly as it will be overwritten the next
    # time the VMware Tools are installed.
    ##########################################################################
    
    description     "VMware Tools services"
    author          "VMware, Inc."
    
    # Be sure to block the display managers until our job has completed.  This
    # is to make sure our kernel services are running before vmware-user
    # may launch.
    # start on... をコメントアウトします。
    # start on runlevel [235] or starting gdm or starting kdm or starting prefdm
    stop on runlevel [06]
    
    pre-start exec /etc/vmware-tools/services.sh start
    post-stop exec /etc/vmware-tools/services.sh stop
    
    上記のように start on runlevel …. 部分をコメントアウトすれば自動起動しないでしょう。

    Upstartとは、
    今まで、Linuxのシステム初期化に利用されていた sysvinit にかわる新しい「init」プログラムです。
    つまり、ちょっと語弊がありますが、ブート時のタスクの起動、シャットダウン時のタスクの停止などでサービスを管理する新しいプログラムになります。

    具体的にサービスの起動方法は、今まで、
    /etc/init.d/vmware-tools start
    と起動していたものが、
    start vmware-tools
    のようになります。

  8. VMwareToolsが正しく動作しているか確認します。

    VMware Player のメニューから、[ 仮想マシン ] – [ 仮想マシンの設定 ] を選択します。
    VMware Tools 共有設定
    VMware Player の仮想マシン設定画面が表示されます。[ オプション ] タブを選択します。
    VMware Tools 共有設定
    画面左から[ 共有フォルダ ] を選択し、画面右上、[ 常に有効 ]を選択し、[ OK ] ボタンをクリックすることで共有フォルダが見えるようになります。
    まだ、共有フォルダが何も設定されていない場合は、右下[ 追加 ]ボタンをクリックして共有フォルダを追加しましょう。

    ここでの説明は、VMware Player 4.0 にて行っています。そのため、メニュー項目や画面イメージが異なることがあります。
    $ cd /mnt/hgfsreturn
    [hgfs]$ lsreturn
    share
    [hgfs]$ cd sharereturn
    [share]$ lsreturn
    test.txt
    	
    

    必ず、共有フォルダは、/mnt/hgfsの配下に見えます。
    上の例では、共有フォルダ名: share の場合、
    /mnt/hgfs/share が共有フォルダとなり、その配下には、test.txt というファイルが見えている・・・ということです。


どうでしたか?

Windowsに比べると面倒ですね。
でも、これが使えると色々試したいときに、共有フォルダが使えるようになりますから、かなり便利ですね。
共有フォルダだけなら、Sambaなどでも代用できますから、Sambaを設定してしまえば良いことなんですけどね。 その他にも、いろいろと恩恵があるので、VMware Player使うならVMwareToolsは設定しておいて損はありません。 お試しあれ。


関連記事 :


コメントを投稿 :

お名前 *

メールアドレス *
( メールアドレスが公開されることはありません。)

サイトアドレス

コメント *

* 印の項目は、入力が必要な項目です。




最近投稿の記事

Genymotionとは、 公式サイト(http://www.genymotion.com/)には、以下のように記述があります。 G ...

以下のように Android x86 を仮想マシンへインストールし、色々と試してきました。 仮想マシンを使って Android ...

Android x86とは、 いわゆる Android のPC版OSです。 Android は、Googleによって開発されたスマー ...

Android x86とは、 いわゆる Android のPC版OSです。 Android は、Googleによって開発されたスマー ...

今回は、Mondo Rescue を使って バックアップとリストア(復元)をやってみたいと思います。 いまだに、さくらのVPSは、バッ ...


さくらのVPS 全プラン リニューアルです。(石狩(北海道)も選択可)


root権限ありで ¥685 / 月 ~ と非常にリーズナブルな CPU 1(core)の 512 プランから、 最高 CPU 10(core), メモリ 32(GB), SSD容量 800(GB) までとプランが充実。
ディスクは、SSDとHDDの選択が可能になった他、データセンターは人気の東京、石狩(北海道)となりました。

また、どのプランでも好きなOSが選べます
( CentOS, Fedora, Scientific Linux, FreeBSD, Ubutu, Debian )

管理人もおすすめのVPSです。
試用期間がありますから、一度、お試しを!!

詳しくは、http://vps.sakura.ad.jp/さくらのVPSのサイトへ へどうぞ!!

カテゴリ


Serverman@VPS 完全1ヶ月無料 キャンペーン実施中です。


Serverman@VPS 完全1ヶ月無料 キャンペーン実施中です。
最近、スワップにも対応した Serverman@VPS は、かなりリーズナブルかもです。

  • メモリ1GB~2GBのEntryプラン :月額:490円
  • メモリ2MB~4GBのStandardプラン :月額:980円
  • メモリ4GB~8GBのProプラン :月額:1,980円

新規申し込みで1ヶ月間完全無料となるキャンペーンを実施中です。
Serverman@VPSの特徴は、安さとIPv6対応です。また、初期設定費0円もポイントです。

IPv6でちょっと遊んでみたい方には、おすすめかもしれませんね。最低利用期間もありませんから、気に入らないときは即解約もできます。

Serverman@VPSの詳細については、 http://dream.jp/vps/ Serverman@VPSのサイトへへどうぞ。



KVM採用 ConoHa VPSは、時間単位で借りれる便利なVPSです。


ConoHa VPS は、初期設定費0円最低利用期間無し時間単位で清算可能、 さらに、Web APIを使って自動化を図ることもできる便利なVPSです。

海外サーバー設置も可能で、ローカル接続にも対応と、かなり、機能豊富なサーバーです。

新規ユーザ登録で、クーポンもらえますから、まずは、お試しですね。

ConoHa VPSの詳細については、
http://www.conoha.jp/ へどうぞ。

KVM採用 お名前.com VPS(KVM) 2G プラン 初期設定費無料 キャンペーン 実施です。


メモリ2GBプラン CPU:3core、Disk:200GB
月額:1,153円から (初期設定:1,680円0円)

さくらのVPSがリニューアルされてもなんのその。
1GBメモリ / 2Core を ¥834 – の格安価格で提供中です!
間違いなくスペックからすると割安感ありです。
年間割引時の途中解約で返金がないのは、 ちょっと残念ですが、それでもこの割安感は魅力です。

まずは、お試しですね。

お名前.com VPS(KVM)の詳細については、
http://www.onamae-server.com/vps/ へどうぞ。(お試し期間が15日あります。)



  • はてなブックマークへ追加する
  • Facebookでシェアする
  • twitter でつぶやく
  • Google Plusでシェアする
  • Pocketでシェアする
ページトップへ
Time : 0.2114 [s]