首页 > 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. 2018年6月14日11:52 | #1

    What’s up, the whole thing is going sound here and
    ofcourse every one is sharing information, that’s genuinely excellent, keep up writing.

  2. 2018年6月14日12:00 | #2

    Helⅼo friеnds, һow iѕ all, and what yoս want to say regarding
    this post, in my view its reаlly remarkable for me.

  3. 2018年6月14日12:04 | #3

    I’m not that much of a internet reader to be
    honest however your weblogs are really nice, keep it up!
    I’ll go ahead and bookmark your site to come back in the future.
    Good luck

  4. 2018年6月14日12:04 | #4

    Keep this going please, great job!

  5. 2018年6月14日12:31 | #5

    But ԝanna comment on few general things, The website pattern is perfect,
    the content is real gߋod :D .

  6. 2018年6月14日12:38 | #6

    Yоur style іs uniqie in comparison to other folks I һave
    rеad stuff fгom. I appгeciate you for posting ԝhen yyou have thе opportunity, Guess I will јust bookmark tһiѕ web site.

  7. 2018年6月14日12:41 | #7

    Hello, this weekend is nice designed for me, for the reason that this
    occasion i am reading this great educational paragraph here at my house.

  8. 2018年6月14日12:54 | #8

    I love your blog.. excellent colors & theme. Did you create this website yourself or did you hire someone to
    do it for you? Plz answer back because I’m looking to create my own blog and would
    like to know where u got this from. thanks a
    lot.

  9. 2018年6月14日12:58 | #9

    If you want to improve your know-how simply keep visiting this web site and be updated with the newest news
    posted here.

  10. 2018年6月14日13:05 | #10

    I wаs wondering iіf you ever thought of changing the page ⅼayout of y᧐ur website?

    Itts vrry wwell written; I love what youve got to sɑy.
    But maybe you could a little more iіn the way of content soo peoplе
    could connect with it better. Youve got ann awful lot of text for only having 1 or tw᧐o pictures.
    Maybe you could space it oout better?

  11. 2018年6月14日13:17 | #11

    Generally I do not read post on blogs, however I wish to say that this write-up very
    forced me to take a look at and do it! Your writing taste has been surprised me.
    Thank you, very great article.

  12. 2018年6月14日13:24 | #12

    what happens when a man without ed takes viagra
    vigra online
    is viagra stronger than cialis
    [url=http://triviagra.com/]vigra online[/url]

  13. 2018年6月14日13:30 | #13

    Thasnks ffor sharing excellent informations. Ⲩour web-site
    iѕ sо cool. I am impressd Ƅy thе details that you havе on this
    blog. Іt reveals how nicely уou understand this subject.
    Bookmarked ths web ρage, will cⲟmе ƅack for extra articles.
    Уou, my friend, ROCK! I foսnd ϳust the informɑtion Ӏ alreаdy searched aⅼl oveг the
    ⲣlace and simply couldn’t сome ɑcross. Wһаt a perfect web-site.

  14. 2018年6月14日13:39 | #14

    I like the valuable information you provide on your articles.
    I will bookmark your blog and check once more right here regularly.
    I am rather certain I’ll learn many new stuff right here!

    Good luck for the next!

  15. 2018年6月14日13:43 | #15

    Hey! I know this is kinda off topic however I’d figured I’d
    ask. Would you be interested in trading links or maybe guest writing a blog article
    or vice-versa? My website covers a lot of the same subjects as yours and I feel we could greatly
    benefit from each other. If you happen to be interested feel free to
    send me an e-mail. I look forward to hearing from you!
    Awesome blog by the way!

  16. 2018年6月14日13:47 | #16

    I’m glad I discovered your article. I would not have made sense of this topic on my own. I’ve read a few other articles on this subject, but I was puzzled till I read yours.

  17. 2018年6月14日13:51 | #17

    Hellо there! This is mʏ 1st comment һere so I
    just wanted to give ɑ quick shout out and telⅼ
    yоu I genuinely enjoy reading through your posts.
    Can you recommend any otheг blogs/websites/forums that deаl with the sɑme subjectѕ?
    Thanks a lot!

  18. 2018年6月14日14:02 | #18

    It’s going to be ending of mine day, but before end I am reading this impressive paragraph
    to improve my know-how.

  19. 2018年6月14日14:05 | #19

    Post writing is also a excitement, if you be acquainted with
    then you can write if not it is difficult to write.

  20. 2018年6月14日14:05 | #20

    Technically, no website needs managed hosting.

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

    Hello there I am so thrilled I found your blog, I really found you by accident, while I was browsing
    on Digg for something else, Anyways I am here now and would
    just like to say kudos for a fantastic post and a all round
    enjoyable blog (I also love the theme/design), I don’t have time to read it all at the moment but I have saved it and also added in your RSS feeds, so when I have time I will be back to read a lot more, Please
    do keep up the excellent work.

  22. 2018年6月14日14:10 | #22

    online casino real money
    casino online for fun
    casino games list
    free casino games and poker

  23. 2018年6月14日14:30 | #23

    Incredible! This blog looks exactly like my old one! It’s
    on a totally different topic but it has pretty much the same
    page layout and design. Excellent choice of colors!

  24. 2018年6月14日14:48 | #24

    I wanted to thank you for this fantastic read!!

    I absolutely enjoyed every little bit of it. I have you book marked to check out new things you post…

  25. 2018年6月14日14:50 | #25

    My partner and I stumbled over here from
    a different web address and thought I might as
    well check things out. I like what I see so i am just following you.
    Look forward to looking at your web page yet again.

  26. 2018年6月14日15:02 | #26

    Outstanding post, thanks and we want more! Added you to FeedBurner.

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

    online casino games
    play casino games online
    online casino games
    casino games real money
    online casino real money

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

    Helⅼ᧐ my ⅼoved one! I want to say tһat this post is amazing, gгeat
    written and come with almost aⅼl significant infos.

    Ӏ’d likе to peer extra posts like this .

  29. 2018年6月14日15:17 | #29

    Hi there, You have done a great job. I will certainly digg
    it and personally recommend to my friends. I’m sure they will be benefited from this web site.

  30. 2018年6月14日15:19 | #30

    Hey! Do you know іf they make any pⅼugins to help with
    SEO? I’m trying tо get my bloց t᧐ rank for some targeted keywordѕ but I’m not seeіng very good success.

    If you know of any please ѕhare. Cheers!

  31. 2018年6月14日15:30 | #31

    I know this if off topic but I’m looking into starting my own weblog and was curious what all is required to get setup?

    I’m assuming having a blog like yours would cost a pretty penny?

    I’m not very internet smart so I’m not 100% positive.

    Any tips or advice would be greatly appreciated. Thank you

  32. 2018年6月14日15:47 | #32

    you are really a excellent webmaster. The web site loading speed is incredible.
    It kind of feels that you are doing any unique trick.
    Also, The contents are masterpiece. you’ve done a fantastic job on this topic!

  33. 2018年6月14日16:00 | #33

    Right here is the right website for anybody who wants to understand this topic.
    You realize so much its almost hard to argue with you (not
    that I personally would want to…HaHa). You certainly put a brand new spin on a subject that’s been written about for years.
    Wonderful stuff, just excellent!

  34. 2018年6月14日16:06 | #34

    I used to be able to find good advice from your articles.

  35. 2018年6月14日16:07 | #35

    Thanks for the marvelous posting! I genuinely enjoyed reading it, you may be a great author.I will make sure to bookmark your blog and will often come back later in life.
    I want to encourage one to continue your great posts, have a
    nice holiday weekend!

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

    Hi! I just wish to give you a big thumbs up for your great information you have got right here on this
    post. I will be coming back to your blog for more soon.

  37. 2018年6月14日16:34 | #37

    It’s going to be ending of mine day, however before end I am reading this impressive post to improve my
    know-how.

  38. 2018年6月14日16:47 | #38

    My partner and I stumbled over hesre different web address annd thought I might check things out.
    I lik what I see so now i am following you. Look frward to checking out
    your web page again.

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

    I used to be suggested this web site by my
    cousin. I’m no longer positive whether this submit is written by means of him
    as nobody else recognize such specified approximately my difficulty.
    You’re amazing! Thanks!

  40. 2018年6月14日16:51 | #40

    I don’t even know how I ended up here, but I thought this post was good.
    I do not know who you are but definitely you are going to a famous blogger if you are not already ;)
    Cheers!

  41. 2018年6月14日16:54 | #41

    My brother recommended I would possibly like this website.
    He was once totally right. This submit actually made my day.
    You can not imagine just how much time I had spent for this information! Thank
    you!

  42. 2018年6月14日17:00 | #42

    Many thanks for helping out, outstanding information.

  43. 2018年6月14日17:02 | #43

    Please let me know if you’re looking for a writer for your site.
    You have some really good posts and I think I would be a good asset.
    If you ever want to take some of the load off, I’d really like to write some
    material for your blog in exchange for a link back to mine.
    Please send me an e-mail if interested. Regards!

  44. 2018年6月14日17:13 | #44

    I need tо to thɑnk you for this fantastic read!! I definitely enjoyed
    every bit off it. I have got you book marked to look at new things you post…

  45. 2018年6月14日17:13 | #45

    Not often do I come across a weblog that is both educational and entertaining,
    and allow me to tell you, you may have hit the nail
    on the head. Your conceptis excellent; the issue is something
    that not sufficient individuals are speaking wisely about.

    I am happy that I found this in my pursuit of something relating to this.

  46. 2018年6月14日17:19 | #46

    It’s awesome designed for me to have a web page, which is valuable for my
    know-how. thanks admin

  47. 2018年6月14日17:21 | #47

    I got this web page from my friend who shared with me regarding this
    web site and now this time I am visiting this site and reading very informative posts
    at this place.

  48. 2018年6月14日17:24 | #48

    Hey there! I’m at work browsing your blog from my new iphone 4!

    Just wanted to say I love reading through your blog and look forward to all your posts!
    Keep up the fantastic work!

  49. 2018年6月14日17:27 | #49

    Знакомиться через Интернет увлекательно и легко.

  50. 2018年6月14日17:27 | #50

    Do you have a spam problem on this blog; I also am a blogger, and I was curious about your situation; we have created some nice practices and we are looking to trade strategies with others,
    be sure to shoot me an email if interested.

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