goo blog サービス終了のお知らせ 

PCに関する雑多な記録

PCに関する諸々の備忘録に変身。

Hyper-V で VMのIPを固定する

2022年06月27日 | 雑多なこと

色々と情報がありますが、自分的まとめ

  • 仮想スイッチを「内部」として新たに作成する。作成したスイッチのIPをDHCPではなくて手動で適切なもので固定する。極端な話DefaultSwitchで一度割り当てられたアドレスでもいいと思う。
    なお、ネットマスクはFFFFF0とかそんな感じにする。
  • VMにOSをインストールする。
  • インストールしたVMのIPを手動で定義する。その際アドレスはスイッチに割り当てたIPにマスクかけて、スイッチ自身を除いた値にする。
  • NAPTの設定をする(これをしないと内部ネットワークから外に出れない)
    New-NetNat -Name "MyNAPT" -InternalIPInterfaceAddressPrefix 172.29.60.14/28 
    MyNAPTはこの設定の名前。 IPとかは適宜自分で設定した値を使う。

こんな感じ。これでIPが固定されるので、FWの設定とかSSHでのログイン時のIPも固定されて結構ハッピー。

Hyper-Vだと母艦の起動と同時にVMもスタートできるし、再起動も起動したまま再起動したら、VMも再起動するように指定できるし、結構便利。

 

 

 

 

 


docker上のCentOS7で/sbin/initを使う

2020年12月19日 | 雑多なこと

一応こんな感じだとできるらしい。systemdのいらん設定を消しまくって、後から必要なものを追加して入れる。
今のところこれだと、母艦への影響はかなり少なく済んでる気がする。

$ cat Dockerfile
FROM centos:7
ENV container docker
RUN yum -y update; yum clean all
RUN yum -y install systemd; yum clean all; \
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*; \
rm -f /etc/systemd/system/*.wants/*; \
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*; \
rm -f /lib/systemd/system/anaconda.target.wants/*;
RUN yum -y install httpd mariadb-server haproxy
RUN systemctl enable httpd
RUN systemctl enable mariadb
RUN systemctl enable haproxy
VOLUME ["/sys/fs/cgroup"]
CMD ["/usr/sbin/init"]

https://dev.classmethod.jp/articles/docker-systemd/
この辺から拝借。

 

https://hub.docker.com/r/centos/systemd/dockerfile

なーんだ、今は公式がちゃんと配布してるじゃないか。。。


disk2vhdでバックアップ

2020年12月04日 | 雑多なこと

sysinternal の disk2vhd を使う。
こんな感じのバッチファイルを使えば、e:\disk2vhd\system-disk1.vhdx
にバックアップが作られる。パーティションに分割している場合は、同一物理ドライブの分は
まとめてバックアップしておいた方がいい。以下のc: の所に複数のドライブレターが書ける。

@echo off
e:
cd \disk2vhd
disk2vhd c: e:\disk2vhd\system-disk1.vhdx

 


vmware xorg.conf

2014年06月06日 | 雑多なこと
とりあえずのコピペ

Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
ModulePath "/usr/lib64/xorg/modules"
FontPath "catalogue:/etc/X11/fontpath.d"
FontPath "built-ins"
EndSection

Section "Module"
Load "glx"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
HorizSync 1-10000
VertRefresh 1-10000
Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection

Section "Device"
### Available Driver options are:-
### Values: : integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option "SWcursor" # [<bool>]
#Option "kmsdev" # <str>
#Option "ShadowFB" # [<bool>]
Identifier "Card0"
Driver "vmware"
BusID "PCI:0:15:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1920x1080"
EndSubSection
EndSection

VMWare Player 3.0

2009年12月01日 | 雑多なこと
VMWare Player 3.0がリリースされています。VMWare 2.5までは、.vmxファイルを作成するには、vmxMakerとか、EasyVMX!を使ったりしたのですが、このバージョンからアプリで作成できるようになりました。仮想ディスクも作成できるので、とりあえず仮想環境で遊ぶには十分になりました。

 さらに、今回のバージョンはWindows7に向けてのチューニングがされていて、XP Modeのイメージをインポートして使うことができます。うれしいことにVMWarePlayerでインポートしても、アクティベーションは不要です。

Firefox 3.5の色がおかしい

2009年06月17日 | 雑多なこと
Firefox 3.5RC1がリリースされています。RCだし、早速更新しました。
そこまではよかったのですが、色が変という事に気づき、いろいろと調べた結果Firefox 3.5で、色の管理をちゃんとするようになったようです。しかし、それまでのプロフィールには、そんな記述はなく、結果として色がおかしくなっていたようです。
 ということで、
http://level.s69.xrea.com/mozilla/index.cgi?id=20070812_Granparadiso
などを参考にして、gfx.color_management.display_profile に、sRGBのプロファイルを設定してあげたら、元の色に戻りました。