0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS7セットアップ(VMWarePlayer上)

Last updated at Posted at 2019-11-03

仮想ネットワーク内のみで利用するCentOSを立ち上げた際のメモです。
基本的に参考にしたサイトの通りに作業しただけです。(最後のネットワークが自動接続になっていなかった問題の対処のみ)

環境

  • ホストOS:Windows7 Enterprise SP1
  • VM:VMWare Workstation 14 Player(14.1.6 build-12368378)
  • ゲストOS:CentOS 7.7(1908)

CentOS取得

  1. https://www.centos.org/
    image.png
    image.png

  2. Older Versions の then click here
    image.png

  3. 7 の Packages の RPMs
    image.png

  4. isos/
    image.png

  5. x86_64/
    image.png

  6. 適当なところをクリック

    (執筆時は http://ftp.tsukuba.wide.ad.jp/Linux/centos/7.7.1908/isos/x86_64/)
    image.png

  7. CentOS-7-x86_64-DVD-1908.iso

VMWare Workstation Player

1.VMWareを起動
image.png

2.新規仮想マシンの作成
image.png

3.インストーラ ディスク イメージ ファイルに、取得した「CentOS-7-x86_64-DVD-1908.iso」を設定
image.png

4.次へ
image.png

5.仮想マシン名、場所を適当に入力し、次へ
image.png

6.デフォルトのままで 次へ
image.png

7.ハードウェアをカスタマイズ
image.png

8.追加...
image.png

9.ネットワーク アダプタ を選択し、完了
image.png

10.ネットワーク アダプタ の 起動時に接続 のチェックを外し、ネットワーク アダプタ2 をホストオンリー に変更
image.png

11.閉じる
image.png

12.完了
image.png

※VMWareに初めてインストールする場合、VMWare Tools Linux版のインストールが促されます。
image.png
image.png

13.インストールを完了しました

CentOSインストール

image.png

  1. Tabキー押下
    image.png

  2. 末尾に「resolution=1024x768」を入力する(=キーではなく、^キーで入力)
    image.png

  3. Enter
    image.png
    image.png
    image.png
    image.png
    image.png

  4. 「j」を入力し、日本語を選択
    image.png

  5. 続行
    image.png

※キーボード、言語サポート、インストールソース、インストール先、KDUMPは変更不要

  1. ソフトウェアの選択
    image.png

  2. インフラストラクチャサーバー
    image.png

  3. 開発ツールにチェック
    image.png

  4. 完了
    image.png
    image.png

  5. インストール先
    image.png

  6. 完了
    image.png

  7. ネットワークとホスト名
    image.png

  8. Ethernet (ens34)を選択し、ホスト名を適当な名前に変更し、Ethernet を オンに変更
    image.png

  9. 完了
    image.png

  10. 日付と時刻
    image.png
    「ネットワーク時刻」を「オン」になっていることを確認

  11. 完了
    image.png

  12. インストールの開始
    image.png

  13. ROOTパスワード
    image.png

  14. 適当なパスワードを入力
    image.png

  15. 完了
    image.png

  16. ユーザーの作成
    image.png

  17. フルネーム、ユーザー名、パスワードを入力する
    image.png

  18. 完了
    image.png

  19. 設定完了
    image.png
    image.png

  20. 再起動
    image.png
    image.png

  21. 作成したユーザーでログイン
    image.png

CentOS設定

  1. selinuxの無効化

    1. selinuxの状態を確認、無効に設定

      $ getenforce
      Enforcing
      $ su -
      # vi /etc/selinux/config
      

      SELINUX=enforcingSELINUX=disabled に変更。

    2. ゲストOSを再起動

      # exit
      $ reboot
      
    3. selinuxの状態を確認

      $ getenforce
      Disabled
      
  2. SSHサービスのセキュリティ設定

    1. 設定ファイル変更(rootユーザーのログインを拒否)

      $ su -
      # vi /etc/ssh/sshd_config        
      

      38行目の #PermitRootLogin yesPermitRootLogin no と変更

    2. サービスの再起動

      # systemctl restart sshd       
      
  3. SSH接続(teraterm)

    1. IPアドレスの確認

      # ifconfig       
      

      image.png

      ens34にIPが振られていない!!

    2. ネットワーク接続

      # nmcli d s      
      

      image.png

      # nmcli c s ens34
      

      connection.autoconnect noとなっている

      # nmcli c m ens34 connection.autoconnect yes
      # nmcli c down ens34
      # nmcli c up ens34
      
      # nmcli d s      
      

      image.png

    3. IPアドレスの確認

      # ifconfig       
      

      image.png

    4. teraterm接続
      無事に接続
      image.png

    5. ゲストOSログアウト

      # exit
      $ exit
      

参照

  1. CentOS 7系で最終リリースのバージョン CentOS 7.7 をインストールする
  2. CentOS 7のインストール後におこなうLinuxの基本設定 13ポイント
  3. centos7 ネットワーク設定
  4. @IT ネットワーク管理の基本Tips:NetworkManagerをコマンドラインから操作するには? nmcliコマンド
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?