首页 > 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 install


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


# 执行下列命令,让用户登录到 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


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

 --size=1.5Gb \

 --ide \

 --ip= \

 --netmask= \

 --gateway= \

 --force  \

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

 --dist=hardy \

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

 --arch=i386 \

 --passwd \


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> boot 

# 启动vps 

xen-shell> console

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

xen-shell> exit

#  退出 xen-shell

xen-shell> help

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

xen-shell> passwd 

# 修改用户登录密码


# 将暂停VPS


# 退出 xen-shell


# 重启 VPS 


# 重新安装系统


# 也是登录VPS控制台

xen-shell> shutdown

# 关闭 vps 虚拟机

xen-shell> status

# VPS 运行的状态


# 发送‘sysreq’按键 到VPS


# 显示系统资源使用率


# 取消暂停


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


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


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

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

分类: xen 标签: , ,
  1. 2018年6月14日07:38 | #1

    Hello I am so grateful I found your web site, I really found you by accident, while I was browsing on Askjeeve
    for something else, Regardless I am here now and would just like to say cheers for a tremendous post and a all round thrilling blog (I also love the theme/design), I don’t have
    time to look over it all at the minute but I have book-marked it and also added your
    RSS feeds, so when I have time I will be back to read more, Please do keep
    up the fantastic jo.

  2. 2018年6月14日07:45 | #2

    (iii) You account on your work, so conserve a professional attitude while
    confronting your customers. The goal would be to find a strategy to give a complete response, all while focusing on as small
    a region of investigation as possible. If you say because over and over again, the one thing people will probably be aware of is because – it is going to stifle your argument and it’s also
    near the top of their list of things you should avoid within your academic work.

  3. 2018年6月14日07:53 | #3

    Hi there, yeah this article is genuinely nice and I have learned lot of things
    from it concerning blogging. thanks.

  4. 2018年6月14日07:56 | #4

    An outstanding share! I’ve just forwarded this onto a friend who had been conducting a little research on this.
    And he actually ordered me lunch simply because I discovered it for him…
    lol. So let me reword this…. Thank YOU for the meal!! But yeah, thanks for spending time to discuss this topic
    here on your internet site.

  5. 2018年6月14日07:59 | #5

    It’s actuallү a cokol and ᥙseful piece of info.
    I’m happy thgat үou shared this usеful info wkth us.
    Pⅼease stay us informed lіke tһіs. Thаnks for sharing.

  6. 2018年6月14日08:00 | #6

    Hi, i think that i noticed you visited my website thus i
    came to return the choose?.I am attempting to to find issues to enhance
    my website!I guess its good enough to use some of your ideas!!

  7. 2018年6月14日08:03 | #7

    Thank you for the auѕpicious writeup. It if truth beе told used to be a entertaiment account
    it. Glance complicated to more delivered agreeable from you!

    However, how ϲan we keep iin touch?

  8. 2018年6月14日08:09 | #8

    Enjoyed ѕtudying this, ᴠety good stuff, regards.

  9. 2018年6月14日08:17 | #9

    My developer is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the costs.
    But he’s tryiong none the less. I’ve been using WordPress on a
    number of websites for about a year and am worried about switching to another platform.
    I have heard good things about blogengine.net.

    Is there a way I can transfer all my wordpress content into it?
    Any kind of help would be greatly appreciated!

  10. 2018年6月14日08:30 | #10

    Howdy, I think your websitе could possibly be having internet brօwser compatibiⅼity issues.
    Whenever Ι look at your blog іn Sɑfaгi, it looks fine however when opening in IE, it’s got some overlapping issues.
    I just wanteԀ to give you a ԛuick heads up! Apart from that,
    excellent ѡebsite!

  11. 2018年6月14日08:44 | #11

    Thank you for sharing your thoughts. I really
    appreciate your efforts and I will be waiting for your next
    write ups thanks once again.

  12. 2018年6月14日08:47 | #12

    casino games list
    casino games real money
    casino games roulette
    casino games

  13. 2018年6月14日08:50 | #13

    Woԝ that was strange. I јust wrote an very long comment but afteг I clіcked submit my
    comment didn’t appear. Grrrr… well I’m not
    writing all that օver again. Anyways, just wаnted to say ѕuperb blߋց!

  14. 2018年6月14日09:01 | #14

    Somebody necessarily help to make significantly articles I would state.
    This is the first time I frequented your website page
    and up to now? I surprised with the analysis you made to create this actual post amazing.
    Magnificent job!

  15. 2018年6月14日09:04 | #15

    Thank you, I have just been looking for information approximately
    this topic for a long time and yours is the greatest I have came upon so far.
    However, what concerning the conclusion? Are you certain in regards to the

  16. 2018年6月14日09:05 | #16

    First off I want to say fantastic blog! I had a quick question in which I’d like to ask if you do
    not mind. I was curious to know how you center yourself and clear your
    thoughts before writing. I have had trouble clearing my
    mind in getting my thoughts out. I truly do
    enjoy 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!

  17. 2018年6月14日09:10 | #17

    hey there and thank you for your info – I have certainly picked up something new from right here.
    I did however expertise several technical points using this site, since I experienced to reload
    the web site a lot of times previous to I could get it
    to load correctly. I had been wondering if your web host is OK?
    Not that I am complaining, but sluggish loading instances times will often affect your placement in google and could damage your high
    quality score if advertising and marketing with Adwords. Anyway I am adding this
    RSS to my email and could look out for a lot more of
    your respective interesting content. Ensure
    that you update this again very soon.

  18. 2018年6月14日09:13 | #18

    The game benefits from a Symbol Expansion Feature.

  19. 2018年6月14日09:16 | #19

    online casino games
    casino slotsslots online
    online casino slots
    online casino gambling
    casino games real money

  20. 2018年6月14日09:22 | #20

    Currently it appears like Drupal is the preferred blogging platform out there right now.
    (from what I’ve read) Is that what you are using on your blog?

  21. 2018年6月14日09:25 | #21

    Keep on working, great job!

  22. 2018年6月14日09:34 | #22

    Fastidious respond in return of this difficulty with genuine arguments and
    describing the whole thing about that.

  23. 2018年6月14日09:38 | #23

    After going over a few of the articles on your site, I truly like your technique of writing a blog.
    I saved as a favorite it to my bookmark website list and will be checking
    back soon. Please check out my web site as well and let
    me know how you feel.

  24. 2018年6月14日09:42 | #24

    Hello i am kavin, its my first time to commenting anyplace,
    when i read this piece of writing i thought i could also make comment due to this sensible paragraph.

  25. 2018年6月14日09:45 | #25

    Very often, the only method to write about an excellent destination is always to contain the expenses paid by someone else.

    The island is incredibly panoramic with lush woodland and red brick or white washed buildings.

    This was huge because it was the very first car not use any petrol or diesel what so ever.

  26. 2018年6月14日09:47 | #26

    Hi, this weekend is fastidious in support of
    me, as this moment i am reading this fantastic informative paragraph here at my house.

  27. 2018年6月14日09:47 | #27

    Can I simply just say what a comfort to uncover somebody that actually
    understands what they’re talking about on the web.
    You definitely know how to bring an issue to light and make
    it important. A lot more people really need to look at this and understand this side of your story.
    I was surprised you’re not more popular because you most certainly
    have the gift.

  28. 2018年6月14日09:49 | #28

    Hi and thank you for the blog post i have been in search of
    this particular information on-line for a while now therefore
    appreciate it.

  29. 2018年6月14日09:56 | #29

    What’s up friends, how is everything, and what you
    want to say on the topic of this post, in my view
    its truly awesome for me.

  30. 2018年6月14日10:01 | #30

    I’ll immediately take hold of your rss as I can’t to find your email subscription hyperlink or e-newsletter service.
    Do you’ve any? Please permit me recognise so that I may just subscribe.

  31. 2018年6月14日10:01 | #31

    If yⲟu want tto grow your know-hоw only keep visiting this web paɡе and Ьe
    uppdated wth the hottest news սpdate ρosted here.

  32. 2018年6月14日10:03 | #32

    Excellent blog right here! Also your web site rather a lot up
    fast! What web host are you the usage of? Can I am getting your affiliate link in your host?
    I desire my web site loaded up as fast as yours lol

  33. 2018年6月14日10:11 | #33

    Eҳcelⅼent post. I wass checking cⲟntinuously this
    blog annd I am impressed! Extremely useful infoo specially the last part :)
    I care for such information much. I was seeking this certaіn information for a long time.
    Thank you and best of luck.

  34. 2018年6月14日10:20 | #34

    Hello there, I discovered your website by means of Google while
    searching for a related subject, your web site got here up, it seems to be great.

    I have bookmarked it in my google bookmarks.

    Hi there, just become alert to your weblog through Google,
    and found that it’s truly informative. I am going to be careful for brussels.
    I will be grateful in case you continue this in future.
    Many other folks will probably be benefited out of your writing.


  35. 2018年6月14日10:21 | #35

    Great post. I’m facing many of these issues as well..

  36. 2018年6月14日10:28 | #36

    vegas casino games
    casino games list
    casino online subtitrat
    casino online

  37. 2018年6月14日10:32 | #37

    Today, I went to the beach with my children. I found a sea shell and gave it
    to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and
    screamed. There was a hermit crab inside and it pinched her ear.

    She never wants to go back! LoL I know this is entirely off topic but I had to tell someone!

  38. 2018年6月14日10:43 | #38

    This is a topic that is closе to mу heart…

    Many thanks! Where are ʏour contact details though?

  39. 2018年6月14日10:49 | #39

    Greetings from Carolina! I’m bored at work so I decided to check out
    your site on my iphone during lunch break. I enjoy the information you provide here and
    can’t wait to take a look when I get home. I’m surprised at how fast your blog loaded on my cell phone ..
    I’m not even using WIFI, just 3G .. Anyways, awesome blog!

  40. 2018年6月14日10:53 | #40

    online casino real money
    casino online subtitrat
    play casinos
    casino online

  41. 2018年6月14日10:56 | #41

    I am really loving the theme/design of your web site.

    Do you ever run into any web browser compatibility issues?
    A couple of my blog visitors have complained about my website not operating correctly in Explorer but looks great in Safari.
    Do you have any solutions to help fix this issue?

  42. 2018年6月14日10:59 | #42

    That іs a very good tip particulɑrly to those fresh to᧐ the blogosphere.

    Short but very accurate info? Thank you for sharing this one.
    A must read artiϲle!

  43. 2018年6月14日10:59 | #43

    I don’t know how I ended up being here, yet I thought this post was good.

    I do not know who you are but definitely you are
    going to a famous blogger when you aren’t
    already All the best!

  44. 2018年6月14日11:08 | #44

    I happen to be reading out a few of your posts and
    i should say wonderful stuff. I’ll certainly
    bookmark your blog.

  45. 2018年6月14日11:09 | #45

    What’s up, this weekend is pleasant in support of me, as this point
    in time i am reading this enormous informative paragraph here at my home.

  46. 2018年6月14日11:14 | #46

    I don’t know if it’s just me or if perhaps everybody
    else experiencing problems with your site. It appears
    as though some of the written text within your posts are running
    off the screen. Can somebody else please provide
    feedback and let me know if this is happening to them
    too? This might be a issue with my internet browser
    because I’ve had this happen before. Many thanks

  47. 2018年6月14日11:18 | #47

    I like what you guys are up too. This type of clever work and exposure!
    Keep up the fantastic works guys I’ve included you guys to my
    personal blogroll.

  48. 2018年6月14日11:22 | #48

    If you desire to get a good deal from this article then you have to apply such techniques to your won web site.

  49. 2018年6月14日11:36 | #49

    Wonderful work! This is the type of information that should
    be shared around the net. Disgrace on the seek engines
    for not positioning this submit upper! Come on over and seek advice from my website .
    Thank you =)

  50. 2018年6月14日11:46 | #50

    Pretty great post. I simply stumbled upon your weblog and wanted to
    say that I have truly enjoyed surfing around your weblog posts.

    In any case I’ll be subscribing for your rss feed and I hope you write again soon!

2+4= (必填)