通过 SSH 访问 VirtualBox Guest

首先在VBox Guest中安装SSH相关软件包:

[kodango@devops ~]$ sudo pacman -S openssh

启动SSH服务,并设置为开机自动启动:

[kodango@devops ~]$ sudo systemctrl start sshd.service
[kodango@devops ~]$ sudo systemctrl enable sshd.service

设置端口转发:
ArchLinux Port Forward

通过SSH连接到指定端口:

Host 'localhost' resolved to 127.0.0.1.
Connecting to 127.0.0.1:3022...
Connection established.
Escape character is '^@]'.

WARNING! The remote SSH server rejected X11 forwarding request.
Last login: Sun Oct 21 19:57:26 2012
[kodango@devops ~]$ ls
share

virtualboxservice可以在Windows下以服务的形式启动VBox Guest。

ArchLinux 10.06 安装

电脑里没有一个可以用的Linux操作系统真是不方便,打算在Vbox中安装一个ArchLinux。连续错过了好几个ArchLinux的版本,这冷安装感觉有很多不一样的地方。最明显的莫过于找不到/arch/setup这个脚本了,官方Wiki里面也没有提及,看来是增加了安装的难度。倒是看到在home目录下有一个install.txt文件。

From Installation Guide:

As of the 2012.07.15 installation media release, AIF (the Arch Installation Framework) is no longer included but instead Arch Install Scripts are provided to aid in the installation process. This article summarizes the install process using these scripts. See the Beginners' Guide instead for a walkthrough aimed at new users.

还有就是/etc/rc.conf文件不再存在了,而且引入了systemd作为initscripts的替换。RHEL和Ubuntu是用upstart来替换initscripts。

另外安装iso启动之后的这个命令行补全功能感觉有点陌生,原来是用了zsh。

archiso_prompt

继续阅读

使用命令行启动 VirtualBox 虚拟机

装上 VirtualBox 就琢磨着如何让它开机自动启动,又或者能够通过命令行的形式直接启动指定的虚拟机。看了下VirtualBox的官方文档,发现有一个命令可以满足我的需求,即VBoxManage。VBoxManage提供了一系列的虚拟机管理命令,包括创建/删除/启动/修改等等,这里不一一列举。有点像Xen的XM命令。不过这里只关心启动虚拟机的命令:VBoxManage startvm。VBoxManage的完整命令列表可以参考这里

VBoxManage startvm子命令可以开启一台状态为关闭或者保存的虚拟机。该命令的语法为:

VBoxManage startvm  uuid>|name... [--type gui|sdl|headless]

可以通过虚拟机的uuid或者name来指定某台虚拟机,可以通过另外一个子命令list列出系统已有的虚拟机:

$ VBoxManage list vms
"XP" {8842d793-228c-458e-a880-8051193fd2db}

我系统上已经安装了一台名为XP的虚拟机,后面括号内部的是它的UUID。

继续阅读

ArchLinux 安装笔记

更新:10.06版本的ArchLinux安装见ArchLinux 10.06安装

ArchLinux已经使用了将近一年了,不过中间找工作、写论文,已经有一段时间没有使用Linux操作系统了。最近因为公司发了一台本本作为办公使用,计划拿到手后安装一个ArchLinux操作系统。对于ArchLinux这个系统,我自己是非常喜欢的,小巧简单,文档丰富(Linux发行版的文档其实都相当丰富),社区完善,一般的问题通过Google搜索都可以找到答案。这篇文章主要,是为了接下来的安装过程做一个笔记,包括系统的配置、软件的安装以及问题的解决之类的。

安装步骤

1. 下载安装镜像

推荐从网易的开源镜像站下载:下载地址

继续阅读