首页 > xen > 使用xen-shell来管理xen vps

使用xen-shell来管理xen vps

2010年6月9日 eric 发表评论 阅读评论

XEN 的强大管理工具 XEN-SHELL,用他来管理XEN的虚拟机,简直是太方便了。太强大了,支持系统重装,VPS 启动、重启、关机、暂停,连接控制台。

 wget http://xen-tools.org/software/xen-shell/xen-shell-1.9.tar.gz
tar zxvf xen-shell-1.9.tar.gz

cd xen-shell

make

make install

1.建立连接VPS的用户与密码

useradd eric

passwd eric

useradd yangzi

passwd yangzi

2.给用户 sudo 的命令权限,和登录shell

vim /etc/sudoers

#加入以下

User_Alias   XENUSERS = eric,yangzi

Cmnd_Alias   XEN      = /usr/sbin/xm

Cmnd_Alias   XENIMG  = /usr/bin/xen-create-image

XENUSERS     ALL    = NOPASSWD: XEN,XENIMG

# 执行下列命令,让用户登录到 xen-shell

chsh -s /usr/local/bin/xen-login-shell eric

chsh -s /usr/local/bin/xen-login-shell yangzi

3.修改xen 虚拟机的配置文件,加入

xen_shell = "eric"

例如:

kernel = "/boot/vmlinuz-2.6.24-28-xen"

ramdisk = "/boot/initrd.img-2.6.24-28-xen"

memory = "64"

name = "xenyang"

xen_shell = "eric"

disk = ['phy:/dev/md0,sda1,w']

root = "/dev/sda1 ro"

on_poweroff = 'destroy'

on_reboot = 'restart'

on_crash = 'restart'

vcpus   = '2'

extra = 'xencons=tty1'

vif = [ '' ]

4.(可选)如果你需要用xen-shell 来重装系统的话,就做这步

在eric 的home 目录下新建image.sh

cd /home/eric

vim image.sh

#!/bin/sh

/usr/bin/sudo /usr/bin/xen-create-image --hostname=yang \

 --size=1.5Gb \

 --ide \

 --ip=192.168.6.36 \

 --netmask=255.255.255.0 \

 --gateway=192.168.6.1 \

 --force  \

 --kernel=/boot/vmlinuz-2.6.24-28-xen \

 --dist=hardy \

 --mirror=http://mirrors.163.com/ubuntu/ \

 --arch=i386 \

 --passwd \

 --dir=/home/eric

5.使用xen-shell 来控制 vps

打开putty 填入 xen 服务器IP地址 输入新建的用户名 eric

xen-shell v1.9

The following commands are available within this shell:

Use of uninitialized value in sprintf at /usr/bin/xen-shell line 1603.

    author -

      boot - Boot the Xen guest.

   console - Gain access to a Xen guest via the serial console.

      exit - Exit the shell.

      help - Show general, or command-specific, help information.

    passwd - Change the password used to access this host.

     pause - This will pause the Xen guest.

      quit - Exit this shell.

    reboot - Reboot the Xen guest.

   reimage - Reset your system to a pristine installation.

    serial - Gain access to the Xen guest via the serial console.

  shutdown - Shutdown the Xen guest.

    status - Show the status of the Xen guest.

    sysreq - Send a 'sysreq' keystroke to the guest.

       top - Show system resource usage.

   unpause - This will unpause the Xen guest.

    uptime - Show the uptime information of your guest system and this host.

   version - Show the version of this shell, and of Xen.

    whoami - Show the user you're connected to the host system as.

For command-specific help run "help command".

xen-shell> 

###下面是 命令介绍 ####

xen-shell> boot 

# 启动vps 

xen-shell> console

# 登录VPS,如果用SSH连不上 VPS,你这样可以登录VPS修改IP地址等。

xen-shell> exit

#  退出 xen-shell

xen-shell> help

# 查看帮助信息,显示命令

xen-shell> passwd 

# 修改用户登录密码

xen-shell>pause

# 将暂停VPS

xen-shell>quit

# 退出 xen-shell

xen-shell>reboot

# 重启 VPS 

xen-shell>reimage

# 重新安装系统

xen-shell>serial

# 也是登录VPS控制台

xen-shell> shutdown

# 关闭 vps 虚拟机

xen-shell> status

# VPS 运行的状态

xen-shell>sysreq

# 发送‘sysreq’按键 到VPS

xen-shell>top

# 显示系统资源使用率

xen-shell>unpause

# 取消暂停

xen-shell>uptime

# 显示您的客户系统和该主机的正常运行时间信息

xen-shell>version

# 显示 xen-shell 和 XEN 的版本信息

xen-shell>whoami

# 显示您已经连接到主机系统的用户。

转载请注明:文章转载自:Eric's linux and nginx! (http://www.nginxs.com)
本文地址:http://www.nginxs.com/linux/185.html

分类: xen 标签: , ,
  1. 2017年12月8日06:10 | #1

    Hi to all, the contents present at this web page are truly remarkable for people
    experience, well, keep up the good work fellows.

  2. 2017年12月8日06:19 | #2

    That is a great tip especially to those fresh to the blogosphere.
    Brief but very precise info… Many thanks for sharing
    this one. A must read article!

  3. 2017年12月8日06:20 | #3

    Thanks for sharing your thoughts about Pearl Jewellery.
    Regards

  4. 2017年12月8日06:22 | #4

    I do not drop many remarks, however I browsed a few responses here Eric's linux and
    nginx! » 使用xen-shell来管理xen vps. I do have a few
    questions for you if it’s allright. Could it be only me
    or do a few of these remarks look as if they are left by brain dead folks?
    :-P And, if you are posting on other social sites, I would like to
    follow you. Would you list of the complete urls of your public sites like your twitter feed, Facebook page or linkedin profile?

  5. 2017年12月8日06:33 | #5

    This post is in fact a pleasant one it assists new net visitors,
    who are wishing for blogging.

  6. 2017年12月8日06:37 | #6

    I must thank you for the efforts you have put in writing
    this blog. I really hope to check out the same high-grade blog posts by you later on as well.

    In fact, your creative writing abilities has inspired
    me to get my own, personal blog now ;)

  7. 2017年12月8日06:39 | #7

    Having read this I thought it was rather enlightening. I
    appreciate you spending some time and effort to put this information together.

    I once again find myself spending a lot of time both reading and
    leaving comments. But so what, it was still worth it!

  8. 2017年12月8日06:44 | #8

    I’m getting dozens of emails from people per hour.

  9. 2017年12月8日06:47 | #9

    I seriously love your website.. Very nice colors & theme. Did you develop this web site yourself?

    Please reply back as I’m wanting to create my very own site and would like to learn where you got this from or what the theme is named.
    Thanks!

  10. 2017年12月8日07:12 | #10

    さらにキム・スヒョンは生涯初の一人二役とアクション演技に挑戦し、カリスマ性をアピールする予定だ。 イ・ジョンソク側も「グラビア撮影とドラマなどで重なる部分が多かった。 [url=http://blog.goo.ne.jp/yyfyyf5][/url]
    それでしっぽ籠池の証人喚問は、3月23日になった。 難しいと思いますよ、脚本だけ読んで映像化するのって。
    [url=http://blog.goo.ne.jp/gdgdgdgd18] 項羽と劉邦 [/url] tvN月火ドラマ「彼女は嘘を愛し過ぎてる」(以下「カノ嘘」)は、正体を隠した天才作曲家のカンハンギョル(イ・ヒョヌ)と、彼に一目惚れしたビタミンボイス女子高生ユンソリム(ジョイ)の純正召喚清涼ロマンス。 それくらい、大野くんがデビューできたことに感動してたんですよ、当時。
    [url=http://blog.goo.ne.jp/gdgdgdgd47]ONE PIECE ワンピース DVD[/url]
    画像のリュクは特戦司(특전사)迷彩で、「太陽の末裔」でも同じ迷彩の戦闘服を着ていましたねぇ。 その点は良心的でいいと思う反面、オークションに出品されたモノが欲しいかどうかを考えると微妙なところ。 [url=http://blog.goo.ne.jp/gdgdgdgd48] 琅邪榜(ろうやぼう) 価格 [/url]
    「美女の誕生」と言うDVD 全身整形手術を受け 美女に生まれ変わる事から始まるコメディー&サスペンスみたいなドラマをみて そうだぁ!  「美女」と言うフレーズに大好き! なんだか心躍ります。 私はその日以来、大人になっても長らく野球中継の、あの応援の声・音を聞く度に拒否反応が起こった。
    [url=http://blog.goo.ne.jp/rtrtrtrt4]{相棒 DVD|相棒 DVDBOX|相棒 動画|相棒ネタバレ|相棒ドラマ|相棒新作|相棒購入}[/url] チャン・グンソクも、脱税疑惑発覚でバラエティ番組『三食ごばん』を急遽降板。 ―ご自身は韓国、中国でこのような結果になることを予想していましたか?ソン・ジュンギ:どの作品でも、結果を予想することなんてできませんよ。
    [url=http://blog.goo.ne.jp/gdgdgdgd48] 琅邪榜(ろうやぼう) ドラマ [/url]

  11. 2017年12月8日07:20 | #11

    best online casino
    online casino usa
    online casino games
    slot casino

  12. 2017年12月8日07:28 | #12

    Hi! Quick question that’s totally off topic. Do you
    know how to make your site mobile friendly? My web site looks weird when browsing from my iphone4.
    I’m trying to find a theme or plugin that might be able to resolve this
    problem. If you have any suggestions, please share.
    Thanks!

  13. 2017年12月8日07:43 | #13

    What’s up, just wanted to tell you, I loved this blog post.
    It was inspiring. Keep on posting!

  14. 2017年12月8日07:58 | #14

    It’s a pity you don’t have a donate button! I’d most
    certainly donate to this superb blog! I suppose for now i’ll settle for bookmarking
    and adding your RSS feed to my Google account. I look forward to fresh updates and
    will talk about this website with my Facebook group.
    Chat soon!

  15. 2017年12月8日08:00 | #15

    今までの暗号は霊が人間に憑依して、人間を操り、作らせた!と証明したから、霊はいます。 XPでもビスタでも、条件を満たしていれば入手可能ということになりますがどうでしょうか、マイクロソフトの正式発表を待ちましょう。 [url=http://www.serialkeys.org/]windows server 購入[/url]
    しかしこんだけブ厚かったらカバンに入らないんじゃないかと思ったが、14.1インチも突っ込めるタイプなので収まった。 しかし、PCの管理者の許可を得てから更新するのは当たり前の話です。
    [url=http://www.office2016jpjp.net/]windows10 ストア アプリ[/url] このボードにOS(Windows10)が入ったSSDやHDD、DVD、カードリーダー、を取り付けます。 お花屋さんやってる友人は母の日にコレやられて最悪だったって怒ってました。
    [url=http://blog.goo.ne.jp/windows8-1]windows 8.1 の ダウンロード[/url]
    タスクトレイに表示される「Windows 10を入手する」から行う自動アップデートを利用したい。 製品名はWindows Vista以後、7・8(8.1)とナンバリングされてきたが、9を飛び越すかたちで「10」となった。 [url=http://www.office2016jpjp.net/]windows 10 の インストール[/url]
    https://products.office.com/ja-JP/office-2016-preview2016をインストールしたら、今までのOfficeは消えるそうです。 ノイズも検出したいのでオーバーオール無帰還で、終段のみカソード帰還がかかってます。
    [url=http://www.serialkeys.org/]windows server[/url]  Windows Updateによる更新作業やWindows DefenderのスキャンもメインPCを超える! 後はWindows 10 Insider Previewを入手に設定、早期に#15025がインストールされて、おかしな管理がないことの確認?!。 「画面下部のタスクバーにあるタスクビューアイコンをクリックすれば、デスクトップで開かれているものだけでなく、バックグラウンドで起動中のアプリも一覧表示されます。
    [url=http://www.office2016jpjp.net/]windows10 ストア アプリ[/url]

  16. 2017年12月8日08:14 | #16

    Just wish to say your article is as amazing.
    The clarity in your post is simply cool and i could
    assume you’re an expert on this subject. Fine with your permission let me to grab your RSS feed to keep updated with forthcoming post.

    Thanks a million and please continue the enjoyable work.

  17. 2017年12月8日08:21 | #17

    What a information of un-ambiguity and preserveness of
    precious know-how regarding unexpected feelings.

  18. 2017年12月8日08:30 | #18

    This is the right blog for anyone who hopes to understand this topic.

    You understand so much its almost tough to argue with you (not that I
    really would want to…HaHa). You certainly put a
    brand new spin on a topic that has been discussed for ages.
    Great stuff, just excellent!

  19. 2017年12月8日08:33 | #19

    Excellent post but I was wanting to know if you could write a litte more on this topic?
    I’d be very grateful if you could elaborate a little bit more.

    Thanks!

  20. 2017年12月8日08:42 | #20

    Hi there colleagues, how is everything, and what you wish for to
    say on the topic of this article, in my view its really
    amazing in favor of me.

  21. 2017年12月8日08:51 | #21

    Hi to every one, for the reason that I am genuinely eager of
    reading this blog’s post to be updated regularly. It includes pleasant material.

  22. 2017年12月8日09:08 | #22

    Do you have any video of that? I’d love to find out some additional information.

  23. 2017年12月8日09:10 | #23

    It’s appropriate time to make some plans for the future and it’s time to be happy.

    I’ve read this post and if I could I wish to suggest you some interesting things or advice.
    Maybe you could write next articles referring to this article.
    I want to read more things about it!

  24. 2017年12月8日09:21 | #24

    Outstanding post but I was wanting to know if you
    could write a litte more on this subject? I’d be very thankful if you could elaborate a little bit further.
    Kudos!

  25. 2017年12月8日09:24 | #25

    An injured party has only six months to file a suit
    against the state if an at fault party is a government employee or agency and the accident occurred within the scope of their employment.
    When it comes to the main numbers of 1 to 50, we organise them in such a manner that each appears
    within your 55 lines no less than five times. And, it goes without saying that storage is a problem which exists in almost every kitchen.

  26. 2017年12月8日09:45 | #26

    I am sure this piece of writing has touched all the internet people, its really really pleasant paragraph on building up new website.

  27. 2017年12月8日10:09 | #27

    I was wondering if you ever thought of changing the page layout of your
    blog? Its very well written; I love what youve got to say.

    But maybe you could a little more in the way of content so people could connect
    with it better. Youve got an awful lot of text for only having 1 or two images.
    Maybe you could space it out better?

  28. 2017年12月8日10:39 | #28

    Thanks for sharing your thoughts about หวย. Regards

  29. 2017年12月8日10:39 | #29

    Hello there! This is my 1st comment here so I just wanted to
    give a quick shout out and say I really enjoy reading your blog posts.
    Can you suggest any other blogs/websites/forums that cover the same subjects?
    Thank you so much!

  30. 2017年12月8日10:50 | #30

    Appreciate this post. Will try it out.

  31. 2017年12月8日10:58 | #31

    real money casino
    free online casino games
    casino games
    real money casino online usa
    casino games

  32. 2017年12月8日11:02 | #32

    First off I would like to say superb blog! I had a quick question in which I’d like to
    ask if you do not mind. I was interested to find out how you
    center yourself and clear your mind prior to writing.
    I’ve had trouble clearing my thoughts in getting my thoughts
    out. I do take pleasure in writing but it just seems like the first 10 to 15 minutes are usually wasted just trying to figure out how to begin. Any suggestions or hints?
    Cheers!

  33. 2017年12月8日11:07 | #33

    An official pharmacy technician training will generally include classroom and laboratory sessions,
    just like in other educational courses. The dispute over his fate
    has made a mockery of all previous diplomatic efforts to end the fighting.
    Being alert, organized and efficient are other key components of a proficient technician.

  34. 2017年12月8日11:11 | #34

    of course like your web site but you have to test the spelling on quite a few of your posts.
    A number of them are rife with spelling problems and I
    find it very bothersome to tell the truth then again I’ll certainly come again again.

  35. 2017年12月8日11:14 | #35

    Its like you read my mind! You seem to know a
    lot about this, like you wrote the book in it or something.
    I think that you can do with some pics to drive the message home a little bit, but other than that, this is great blog.

    A fantastic read. I will certainly be back.

  36. 2017年12月8日11:17 | #36

    This piece of writing will help the internet viewers for creating new website
    or even a weblog from start to end.

  37. 2017年12月8日11:20 | #37

    Very descriptive article, I loved that a lot. Will there be a part 2?

  38. 2017年12月8日11:21 | #38

    I used to be recommended this blog via my cousin. I’m
    not positive whether this submit is written by means of him as nobody else recognise such distinct about my trouble.
    You are wonderful! Thank you!

  39. 2017年12月8日11:23 | #39

    Having read this I believed it was rather informative.
    I appreciate you spending some time and effort to put this article together.
    I once again find myself spending a significant amount of time both reading and leaving comments.
    But so what, it was still worthwhile!

  40. 2017年12月8日11:35 | #40

    online casino
    [url=http://real777money.com/]casino online[/url]
    casino online
    free online casino games

  41. 2017年12月8日11:36 | #41

    Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something.
    I think that you can do with a few pics to drive the message home a bit, but other than that, this is fantastic
    blog. A great read. I’ll certainly be back.

  42. 2017年12月8日11:38 | #42

    One method that writing a university essay is unique from secondary school
    is the fact that the topics you may get to pick from
    10 to become a great deal broader in scope and thus are offered to a number
    of interpretations. If you are within a strict budget obtain only one professional outfit and use it for the interviews.
    Do not stop until you’re able to produce the very best quality
    articles that your prospective clients will die for.

  43. 2017年12月8日11:40 | #43

    Definitely believe that which you stated. Your favorite reason seemed
    to be on the internet the simplest thing to be aware of.
    I say to you, I definitely get annoyed while people think about worries that
    they plainly do not know about. You managed to hit the nail upon the top
    and defined out the whole thing without having side effect
    , people can take a signal. Will likely be back to get
    more. Thanks

  44. 2017年12月8日11:45 | #44

    Hi there, this weekend is pleasant designed for me,
    because this occasion i am reading this fantastic educational post
    here at my home.

  45. 2017年12月8日11:50 | #45

    Great post. I used to be checking constantly
    this weblog and I’m inspired! Extremely useful info particularly the last section :
    ) I deal with such information much. I was seeking this certain information for
    a long time. Thank you and best of luck.

  46. 2017年12月8日11:58 | #46

    Hello, Neat post. There is a problem together with your site in internet explorer, would check this?
    IE nonetheless is the market leader and a big part of folks will leave out
    your wonderful writing because of this problem.

  47. 2017年12月8日12:03 | #47

    I have been browsing on-line more than three hours lately, yet I by no
    means discovered any interesting article like yours. It’s beautiful value enough for me.
    In my opinion, if all site owners and bloggers made excellent content material
    as you probably did, the internet will likely be a lot more helpful than ever
    before.

  48. 2017年12月8日12:09 | #48

    I loved as much as you will receive carried out right here.
    The sketch is tasteful, your authored subject matter stylish.
    nonetheless, you command get bought an edginess
    over that you wish be delivering the following. unwell unquestionably come further
    formerly again since exactly the same nearly a lot often inside case you shield this hike.

  49. 2017年12月8日12:09 | #49

    Its like you read my mind! You appear to knopw so much about this,
    like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a little bit, but oyher than that, this is fantastic blog.

    A fantasstic read. I’ll definitely be back.

  50. 2017年12月8日12:14 | #50

    管理者はグループポリシーの更新間隔の設定で、この間隔を変更することができる。 ※ブログの公開は最後に「ページを最近情報に更新」のメセージを「クリク」しないと・・・、記事は公開できない状態です。 [url=http://italian-machazor.com/1777/office2013_1/index.html]office 2013 価格[/url]
     さらにロシア通信大手メガフォン(MegaFon)も同日、サイバー攻撃が原因でコールセンター業務に支障が発生したと公表した。 同級生で S ウィスキー社長提供のウェルカムドリンクを飲みながら宴会場が開くのを待ち、その後は3時間盛大に催された。
    [url=http://www.petscript.net/17711/officemac_1/index.html]office mac 価格[/url] レベル高い神は悪口言わないね!ニールアームストロングのストロング。 G302も悪くないのですがメイン用にするのは悩ましい。
    [url=http://sangitadevi.com/17710/office2013_1/index.html]office2013 personal 価格[/url]
    ただ一つの試験の準備をするだけで時間をたくさん無駄にすることをやめてください。  以前にも触れたように、MicrosoftはWindows 10の名称が付くOSのリリース計画において、「大きなマイルストーン」と「小さなマイルストーン」を設定している節がある。 [url=http://www.sternenbote-blog.com/1777/windows10_1/index.html]produkey windows 10[/url]
    今回の動画は約10分半、お時間のある方はご覧ください。 それを反映したのが,1月6日に開かれたIntelのCEOであるBrian Krzanich氏による基調講演だ。
    [url=http://www.sherbetangel.co.za/17714/office2010_1/index.html]office 2010 価格[/url] 今の場所が不満で、別のところに行っても、そこでも不満になるのでしょう、それなら、今の所で続けて行こうという気にもなります。 びっくりして、もう一つの方のアカウントのものを調べてみた。
    [url=http://www.villard.cl/17711/win_server_1/index.html]windows server 認証[/url]

评论分页
订阅评论
0+8= (必填)