Category Archives: Etc…

Xvnc 接続の際に vnc パスワードを設定する

Xvnc をインストールして、/etc/inetd で動かす際に vnc パスワード設定したい場合。

vnc 接続の際のパスワード無しの場合は、/etc/inetd.conf に下記のように記述するとして、

vnc5901    stream    tcp    nowait    nobody    /usr/local/bin/Xvnc    Xvnc -inetd -query localhost -once -geometry 1024×640 --securitytypes=none

vnc 接続の時にパスワードを設定したい場合は、まず適当なディレクトリに vnc パスワードを作成する。今回は、/home/regza/.vnc の中に作ることとしたら、

> cd /home/regza/.vnc
> vncpasswd

のように、パスワードを作成しておき、/home/regza/.vnc/passwd のパーミッションを変える(参考:644)。

/etc/inetd.conf は、下記のようにする。

vnc5901    stream    tcp    nowait    nobody    /usr/local/bin/Xvnc    Xvnc -inetd -query localhost -once -geometry 1024×640 --securitytypes=VncAuth --PasswordFile=/home/regza/.vnc/passwd

これで、vnc 接続時にパスワードを聞いてくる。

 

 

xrandr マルチディスプレイ

> xrandr
Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 1680 x 1680
VGA connected 1680×1050+0+0 (normal left inverted right x axis y axis) 473mm x 296mm
1680×1050      60.0*+
1280×1024      75.0     60.0
1440×900       75.0     59.9
1280×960       60.0
1280×800       59.8
1152×864       75.0
1024×768       75.0     70.1     60.0
832×624        74.6
800×600        72.2     75.0     60.3     56.2
640×480        75.0     72.8     66.7     59.9
720×400        70.1
LVDS connected 1366×768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366×768       59.6*+
1024×768       85.0     75.0     70.1     60.0
832×624        74.6
800×600        85.1     72.2     75.0     60.3     56.2
640×480        85.0     72.8     75.0     59.9
720×400        85.0
640×400        85.1
640×350        85.1

と確認しておいてから、

  • VGA 1680×1050
  • LVDS 1366×768

で構成する場合、

単純に次のコマンドを打つとエラーが表示される場合がある。

> xrandr --output VGA - -mode 1680×1050 --left-of LVDS --output LVDS --mode 1366×768
xrandr: screen cannot be larger than 1680×1680 (desired size 3046×1050)

2つのディスプレイを左右に並べる合は、仮想的な最大スクリーンサイズが (1680+1366)x1050 になると想定する。

(1680+1366)x1050 = 3046x1050

2つのディスプレイを上下に並べる場合は、仮想的な最大スクリーンサイズが 1680x(1050+768) になる。

1680x(1050+768) = 1680x1818

で、どっちでもいけるようにするならば、それぞれの最大値をとって、3046x1818 仮想的なスクリーンに、2つのディスプレイを配置することになる。

参照:Xorg RandR 1.2 - ThinkWiki

この値を、/etc/X11/xorg.conf に記述する。

Section “Screen”
    Identifier “Screen0″
    Device     “Card0″
    Monitor    “Monitor0″
    DefaultDepth    24
    SubSection “Display”
        Viewport   0 0
        Virtual 3046 1818
    EndSubSection
EndSection

↑実は、ここで Virtual 3046×1818 と書いてしまうとハマル。 x は不要。

一度、再起動しておいてから、

> xrandr --output VGA --mode 1680×1050 --left-of LVDS --output LVDS --mode 1366×768

VirtualBox の kldload vboxdrv でエラーが表示されます

oracle VM VirtualBox Manager 4.1.8_OSE

 

FreeBSD 9.0 で VirtualBox をインストールして起動したら、アレが表示された。

Kernel driver not installed (rc=-1908)
Make sure the kernel module has been loaded successfully.

あ、そうだ、そうだ、そうだった ⇒ VirtualBox インストール編

で、

# kldload vboxdrv.ko

としたら、

kldload: can’t load vboxdrv: File exists

・・って、あれ?何か間違えたかな?

# kldconfig -r
/boot/kernel;/boot/modules

からの、

# ls -al /boot/modules/vbox*
-r-xr-xr-x  1 root  wheel  213319  3月 15 13:54 vboxdrv.ko
-r-xr-xr-x  1 root  wheel    8340  3月 15 13:54 vboxnetadp.ko
-r-xr-xr-x  1 root  wheel   22339  3月 15 13:54 vboxnetflt.ko

うんむ~。

ログを見てみよう。

/var/log/messages

Mar 15 22:21:27 xorg kernel: KLD vboxdrv.ko: depends on kernel - not available or version mismatch

解決しないので、ぐぐった。英語のページでは質疑応答があるような・・・と日本語のページにヒントが書かれておりました。

こちら様です ⇒ VirtualBoxモジュールがロードできない « サーバいじくり雑記

>システムとカーネルを最新にしてインストールしたらうまくいきました。

ではやってみましょう。

buildworld & buildkernel & installkernel & installworld を行ってから、再び、どんっ!

# kldload vboxdrv.ko

通った!

※その他参考サイト ⇒ VirtualBox FreeBSD Wiki

 

FONT : msgothic.ttc msmincho.ttc

# mkdir /usr/local/share/font-ms
# cd /usr/local/share/font-ms
# cp ~/ms*.ttc ./
# mkfontdir
# mkfontscale
# cd /usr/local/share/fonts/TTF
# ln -s /usr/local/share/font-ms/msgothic.ttc msgothic.ttc
# ln -s /usr/local/share/font-ms/msmincho.ttc msmincho.ttc

 あとは、firefox 等で確認する。

 

 

squid-3.1.16

ちょっと脱線。squid をインストールするのでメモりながらやる。

www/squid31

# cd /usr/ports/www/squid31
# make config-recursive
# make install clean

オプションはデフォルトでインストールした。

===> post-installation information for squid-3.1.16:

     o You can find the configuration files for this package in the
       directory /usr/local/etc/squid.

     o The default cache directory is /var/squid/.
       The default log directory is /var/log/squid/.

       Note:
       You must initialize new cache directories before you can start
       squid.  Do this by running “squid -z” as ‘root’ or ‘squid’.
       If your cache directories are already initialized (e.g. after an
       upgrade of squid) you do not need to initialize them again.

     o The default configuration will deny everyone but the local host and
       local networks as defined in RFC 1918 for IPv4 and RFCs 4193 and
       4291 for IPv6 access to the proxy service.  Edit the “http_access
       allow/deny” directives in /usr/local/etc/squid/squid.conf
       to suit your needs.

     To enable Squid, set squid_enable=yes in either
     /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/squid
     Please see /usr/local/etc/rc.d/squid for further details.

     Note:
     If you just updated your Squid installation from an earlier version,
     make sure to check your Squid configuration against the 3.1 default
     configuration file /usr/local/etc/squid/squid.conf.default.
    
     /usr/local/etc/squid/squid.conf.documented is a fully annotated
     configuration file you can consult for further reference.

     Additionally, you should check your configuration by calling
     ‘squid -f /path/to/squid.conf -k parse’ before starting Squid.

===>   Compressing manual pages for squid-3.1.16
===>   Registering installation for squid-3.1.16
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/squid/squid_radius_auth
/usr/local/sbin/squid

      This port has installed the following startup scripts which may cause
      these network services to be started at boot time.
/usr/local/etc/rc.d/squid

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type ‘make deinstall’
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:

http://www.squid-cache.org/

とりあえず読みながらやってみる。

ローカル以外からのアクセすは DENY になっているとのこと。

設定ファイルは /usr/local/etc/squid/squid.conf  なので必要に応じて変更。

cache_dir ufs /var/squid/cache 1000 16 256

で、

# squid -z

これで、/var/squid/cache が作られた。

覚えておく部分のメモ

http_port 3128

このまま、/etc/rc.conf に追記する。

suqid_enable=”YES”

ここまでは、上記の説明に記載されているとおり。

で、squid を起動してみる。

/usr/local/etc/rc.d/squid start

OK。