I’m sorry for the long title. Due to lack of documentation, it’s not easy to use python xpcom api from virtualbox sdk. The code below is just a sample that lists your installed virtual machines. It works on linux with VirtualBox OSE 2.0.8. Hope useful to you.
[cc lang="python"]
import vboxapi
vmsg = vboxapi.VirtualBoxManager(None, None)
vbox = vmsg.vbox
vmsg.mgr.getSessionObject(vbox)
machs = vbox.getMachines()
names = map(lambda x: (x.name,x.id), machs)
print names
[/cc]
Output:
[cc lang="python" nowrap="false" line_numbers="false"]
[(u'Ubuntu', u'aac3fd46-4f1e-4f6e-8abe-b1a5516abf8c'), (u'Windows', u'fa73952e-f0a6-4bf0-af20-259513d73bc1'), (u'OpenSolaris', u'a951542c-3178-4a6b-8087-f1b0314e283a'), (u'LinuxMint', u'8191f256-1b76-4ce7-a202-93730dae1b33'), (u'Fedora', u'ca250f45-d752-4baf-9281-fb0847dc8287'), (u'Freebsd', u'8322b62a-aed5-4f04-9815-9fadfeba9fe1'), (u'ArchLinux', u'efc1167a-4e06-4c14-aeb0-bfb303c8f5f7'), (u'openSUSE', u'02e18816-311d-420b-99b3-6b4b4cccf7b7'), (u'CentOS', u'ccf0421c-85c4-4123-8722-57abc494c633')]
[/cc]
Posts Tagged ‘VirtualBox’
List your installed virtualbox virtual marchines using vbox python xpcom api
02月 12, 20103 Screenshots
09月 10, 2009JConsole
下午给验证码做压力测试,用JMX监控Tomcat性能情况,200并发。Tomcat的配置,initial memory pool是512M,Max是768M。在15:30时我手动执行了一次GC。

Netpanzer
跨平台的联机坦克游戏,今天才知道可以和Bot玩,来看看这种寂寞的玩法。
开一个terminal(或者用screen也可以):
netpanzer -d
再开一个terminal,添加两个bot
netpanzer -b localhost &
netpanzer -b localhost &
自己进游戏
netpanzer -c localhost
之前一直不知道,也怪自己,不知道打游戏也可以–help

VirtualBox
VirtualBox 3.0.6 今天发布了,fix了从3.0.2开始与archLinux 2.6.30内核的冲突,阔别已久的arch在VirtualBox上终于又可以运行了,但是:

Two Screenshots
How you waste your storage?
06月 6, 2009
250G硬盘是这样被使用的。一个K桌面的ArchLinux,一个俄语界面的LinuxMint,一个出于好奇心的OpenSolaris,一个用来测试的Ubuntu Server,以及,以及一个不能免俗的盗版Windows。
Check here to see a complete installation guide of Ubuntu Linux on VirtualBox.