修改eucalyptus里面vm

 

使用uec搭建起eucalyptus的云以后,一个要解决的问题是如何在vm里面安装软件。如果直接登录安装肯定是不行的,因为vm关闭以后就不存在了。

 

安装的方法主要参考如下的内容:

http://open.eucalyptus.com/participate/wiki/install-tomcat-image

http://open.eucalyptus.com/participate/wiki/modifying-prepackaged-image

 

mkdir temp-mnt
associate a loop block device to the image ( I assume here that /dev/loop5 is free)
losetup /dev/loop5 root.img
and finally mount it
mount /dev/loop5 temp-mnt

it is probably a good idea to make procfs, dev and sysfs available in your chrooted environment (this will allow a greater set of tools to work correctly). To do so:

mount -o bind /proc temp-mnt/proc (这一步是必须的,否则安装java会失败)
mount -o bind /sys temp-mnt/sys
mount -o bind /dev temp-mnt/dev

You now have the image under temp-mnt and you can copy over what you want into it. Pay attention to not overfill the image (you can check with df). If you want to install packages into it, you have few options:

  • chroot temp-mnt and use apt-get or yum or zypper to install what you want
  • you can instruct the package manager program to use a different root (for example both dpkg and rpm uses the --root option)

如果新的系统locale设置有问题,运行apt-get等命令会报错,请参考另一篇文章。

 

Once your are done modifying the image, you should

must first use 'umount -n temp-mnt/proc'
umount /dev/loop5 (如果umount失败,请参阅另一篇文章)
losetup -d /dev/loop5

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值