LoginSignup
0
0

More than 3 years have passed since last update.

(作業中)rhel on virtual box 環境構築メモ

Posted at
  • subscription-managerを使ってサブスクライブするのではなく,epel等のリポジトリを使いたいというケースです. ※ 作業中でまだ詰まってます. help ※ まとめ体部分からまとめていきます. ※ rhelのisoの準備とosインストールは省きます. ※ Host only adapterと,ssh用のipアドレスの設定くらいは書くかも

VirtualBox Guest Additionsをインストール

VirtualBox Guest Additionsをインストールする

  • hostとのshareフォルダ等使えるようになる
  • ...

virtualbox に redhatのisoを装入

Screen Shot 2019-09-05 at 21.16.59.png

mountする

mkdir /media/cdrom
mount /dev/cdrom /media/cdrom

isoから必要なものをインストール

/etc/yum.repos.d/
vim /etc/yum.repos.d/iso-rlel.repo
yum repolist

rm -rf /var/cache/yum/*
yum clean all
yum install bzip2 gcc kernel-devel

VirtualBox Guest Additionsのインストール

mount /dev/cdrom /media/vb/
cd /media/vb/
sh VBoxLinuxAdditions.run

解像度の変更(必要なら)

vim /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg

umount /mnt/vb/
shutdown -r now

sshの設定

host側で, share folder に public keyをおいて,

cd
mkdir .ssh
cd /media/sf_share_rhel/
cp id_rsa.pub ~/.ssh/
cd
chmod 700 .ssh
chmod 600 .ssh/id_rsa.pub

host コピペやいつも使っているショートカットが捗るので,ここからはrhelにsshで接続します.

ssh root@192.168.56.2 -i ~/.ssh/id_rsa
yum install wget
wget https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
rpm -ivh epel-release-7-11.noarch.rpm

rm -fr /var/cache/yum/*
yum clean all
yum repolist all

ここで

yum install python をすると以下のようなメッセージが

Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Nothing to do

で,とりあえず以下を実行

5.2. Subscription Manager リポジトリーの無効化 Red Hat サブスクリプション管理 1

subscription-manager config --rhsm.manage_repos=0

また,サブスクリプションマネージャーに登録できますというメッセージがも毎度毎度出てきて辛いので消す.
手順は2つのファイルを編集してenable=0にするだけである。

vim /etc/yum/pluginconf.d/subscription-manager.conf
[main]
enabled=0

で,再びyum install pythonを実行してみると

Loaded plugins: langpacks, product-id, search-disabled-repos
Nothing to do

つかれたので今日は終わり,

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