文系男子が日和るIT開発~IT知識なしで飛び込んだIT企業

文系男子だからIT企業に就職するなんて考えてもみませんでしたが、日和ながら日々くらいついています。

VMWareとWindowsでのファイル共有のためのvmware-toolのインストール

VMWareWindowsでのファイル共有できるようようにしたので、その手順をご紹介します。

 

vmware-toolのインストール

VM Ware Toolのインストールから。

VMWareの設定で、まず、下記のように進み、VM Ware Toolのダウンロードを行う。

Player->管理->VMWare Toolsのインストール

ダウンロードを選択。

 

ダウンロードしたWMWare Toolをマウントさせる。

cd  /mnt

mkdir cdrom

llコマンドで、/mnt/cdromが作成されていることを確認する。

mount /dev/cdrom1 /mnt/cdrom

マウント実行後、下記のようなメッセージが表示されるが、
マウントはおそらくうまくできているはず。

  mount : block device /dev/sr0 is write-protected, mounting read-only

 

なお、

■mountコマンドの書式:

mount [フラグ] [ファイルシステム] [マウント対象] マウントポイント

■mountコマンドの主なオプション:

  • -a : /etc/fstabにautoが設定された場所をマウント
  • -t : ファイルシステムの指定。(ext3やxfsなど)
  • -o : 指定した場所でマウントを実行
  • -v : 詳細表示
  • オプションなし:現状のmount状況の確認

 

cd /mnt/cdrom

llコマンドでマウント内容の結果を確認。

VMWareTools--XXXXX.tar.gz があることを確認する。

 

次に「VMWareTools--XXXXX.tar.gz」を展開する。

展開用にワーク用ディレクトリを作成し、そこで展開する。

 mkdir -p /tmp/work/vmwaretools

 cd /tmp/work/vmwaretools

 tar xvfz VMWareTools--XXXXX.tar.gz

 

■tarコマンドの書式:

tar [オプション1] [オプション2] [ファイル名]

■tarコマンドの主なオプション:

  • c : 書庫を作成する(tarファイルの作成)
  • x : 書庫を展開する(tarファイルの展開)
  • t : 書庫の内容を表示する(tarファイルの中身を表示)
  • g : gzipを通して処理する
  • -C  ディレクトリ名 : 指定したディレクトリに移動した後、処理する
  • -T  ファイル名 : 指定したファイルから抽出または作成するファイル名を読み込む

 

展開後に「vmware-install.pl」が存在することを確認する。

find ./ -tyep f -name 'vmware-install.pl

実行結果は、./vmware-tools-distrib/vmware-install.pl。
なので、ディレクトリを移動し、「vmware-install.pl」を実行する。

cd vmware-tools-distrib

./vmware-install.pl

 

 実行結果。

[xxxx@localhost vmware-tools-distrib]# ./vmware-install.pl
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]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]

What is the directory that contains the init scripts?
[/etc/rc.d/init.d]

In which directory do you want to install the daemon files?
[/usr/sbin]

In which directory do you want to install the library files?
[/usr/lib/vmware-tools]

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]

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]

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]

The installation of VMware Tools 9.9.3 build-2759765 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]

Initializing...


Making sure services for VMware Tools are stopped.

Stopping Thinprint services in the virtual machine:
   Stopping Virtual Printing daemon:                                   done
Stopping VMware Tools services in the virtual machine:
   Guest operating system daemon:                          [  OK  ]
   VMware User Agent (vmware-user):                        [  OK  ]
   Unmounting HGFS shares:                                 [  OK  ]
   Guest filesystem driver:                                [  OK  ]


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.

The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer.

The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer.

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]

Found a compatible pre-built module for vmhgfs.  Installing it...


Found a compatible pre-built module for vmxnet.  Installing it...

The vmblock enables dragging or copying files between host and guest in a
Fusion or Workstation virtual environment.  Do you wish to enable this feature?
[yes]

VMware automatic kernel modules enables automatic building and installation of
VMware kernel modules at boot that are not already present. This feature can be

enabled/disabled by re-running vmware-config-tools.pl.

Would you like to enable VMware automatic kernel modules?
[no]

Thinprint provides driver-free printing. Do you wish to enable this feature?
[yes]


Disabling timer-based audio scheduling in pulseaudio.

Do you want to enable Guest Authentication (vgauth)? [yes]

Distribution provided drivers for Xorg X server are used.

Skipping X configuration because X drivers are not included.

Creating a new initrd boot image for the kernel.
   Starting Virtual Printing daemon:                                   done
   Checking acpi hot plug                                  [  OK  ]
Starting VMware Tools services in the virtual machine:
   Switching to guest configuration:                       [  OK  ]
   Guest vmxnet fast network device:                       [  OK  ]
   VM communication interface:                             [  OK  ]
   VM communication interface socket family:               [  OK  ]
   Guest filesystem driver:                                [  OK  ]
   Mounting HGFS shares:                                   [FAILED]
   Blocking file system:                                   [  OK  ]
   Guest operating system daemon:                          [  OK  ]
The configuration of VMware Tools 9.9.3 build-2759765 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.

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, either reboot or
1. stop networking or stop any interface using the vmxnet or pcnet32 driver
2. remove the pcnet32 module with 'rmmod pcnet32'
3. remove the vmxnet module with 'rmmod vmxnet'
4. load the vmxnet module with 'modprobe -v vmxnet'
5. and restart networking or restart the stopped network interfaces

Enjoy,

--the VMware team

Found VMware Tools CDROM mounted at /media/VMware Tools. Ejecting device
/dev/sr0 ...
Found VMware Tools CDROM mounted at /mnt/cdrom. Ejecting device /dev/sr0 ...

 

正常終了した後に、OSをrebootさせる。

reboot

 

reboot後に、「vmware-tools」を開始する。

/etc/init.d/vmware-tools start

上記コマンド実行後、

/etc/init.d/vmware-tools status

で状態確認。

vmtoolsd is running

ならインストールOK。

 

VM Ware Toolインストール後の確認と設定

VM Wareの設定で、
Player->管理->仮想マシンの設定 で「オプション」タブを選択する。
「共有フォルダ」のメニューでWindowsVMware間でファイル共有を行いたいフォルダを選択して、完了。

f:id:dreamjourney:20151206021544j:plain

 

 

文系男子としてのコメントとしては

mountコマンドは実務での使用経験はないので、こういう時、VM Wareは便利。
実際に使って試すことができる。

findコマンドやtarコマンドは、文系男子的には小難しいレベルのコマンド。
ただし、重要度は高いので、基礎は覚えたほうがよさそう。

特に、オプションは今回基礎的なものしか掲示してないが、覚えておくと有益なコマンドは他にも多数あると思われます。

findコマンドなどは他のコマンドと複合的に使うテクニックもあるようなので、何とか身に着けたいです。