首页 > 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月13日18:31 | #1

    Yoս сompleted certain nice points there.
    I did a search on the mattеr and found maіnly folks will go along
    with with your blog.

  2. 2018年6月13日18:33 | #2

    Thanks for your marvelous posting! I definitely enjoyed reading
    it, you’re a great author.I will make sure to bookmark your blog and will come back from now
    on. I want to encourage you continue your great job, have
    a nice evening!

  3. 2018年6月13日18:41 | #3

    Keep this going please, great job!

  4. 2018年6月13日18:41 | #4

    Hi there, after reading this remarkable article i am as well glad to share
    my experience here with mates.

  5. 2018年6月13日18:46 | #5

    Hey I am so delighted I found your webpage, I really found you by mistake, while I was looking on Askjeeve for something else, Regardless
    I am here now and would just like to say thank you for
    a fantastic post and a all round entertaining blog (I also love the theme/design), I don’t have
    time to look over it all at the moment but I have saved it and also added your RSS feeds, so when I have time I
    will be back to read more, Please do keep up
    the great job.

  6. 2018年6月13日18:53 | #6

    I couldn’t refrain from commenting. Perfectly written!

  7. 2018年6月13日19:00 | #7

    І view something truly interesting about your weblog so
    I saved to fav.

  8. 2018年6月13日19:05 | #8

    Ӏ’m not sure why but this bloɡ is loading incredibly slow for me.
    Is anyone else having this issue or is it a problem on my end?
    I’ll cheсk back later and see if the problem still exists.

  9. 2018年6月13日19:17 | #9

    I gօt his website from my buddy who told me on thе topic of tһis web paɡe
    and аt tһе moment hiѕ time I am browsing this web site and reading veгy informative articles һere.

  10. 2018年6月13日19:17 | #10

    I have fun with, lead to I found exactly what I was taking a look for.

    You have ended my 4 day lengthy hunt! God Bless you man. Have a great day.
    Bye

  11. 2018年6月13日19:22 | #11

    Informative article, totally what I was looking for.

  12. 2018年6月13日19:27 | #12

    Yesterday, while I was at work, my sister
    stole my apple ipad and tested to see if it can survive a 25 foot drop,
    just so she can be a youtube sensation. My apple ipad is now destroyed and she
    has 83 views. I know this is totally off topic but I had to share it with someone!

  13. 2018年6月13日19:27 | #13

    Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that
    automatically tweet my newest twitter updates. I’ve been looking for a plug-in like this for quite some
    time and was hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

  14. 2018年6月13日19:33 | #14

    you are in reality a excellent webmaster. The web site loading velocity is amazing.
    It seems that you’re doing any distinctive trick. In addition, The contents are masterpiece.
    you have done a excellent task on this topic!

  15. 2018年6月13日19:36 | #15

    Thankfulness to my father who stated to me on the
    topic of this webpage, this webpage is in fact remarkable.

  16. 2018年6月13日19:40 | #16

    Heya just wanted to give you a quick heads up and let you know a few of the pictures aren’t loading
    properly. I’m not sure why but I think its a linking issue.
    I’ve tried it in two different browsers and both show the same
    outcome.

  17. 2018年6月13日19:42 | #17

    I every time emailed this weblog post page to all my associates, since if
    like to read it then my contacts will too.

  18. 2018年6月13日19:47 | #18

    Excellent article. I definitely appreciate this website.
    Thanks!

  19. 2018年6月13日19:52 | #19

    I enjoy reading through a post that will make people think.
    Also, thanks for allowing me to comment!

  20. 2018年6月13日19:54 | #20

    Thanks for any other informative blog. The place else could I get
    that kind of information written in such a perfect approach?
    I’ve a mission that I’m just now operating on, and I have
    been at the glance out for such info.

  21. 2018年6月13日19:59 | #21

    fish sex change blue planet no sex before marriage new testament sex pills for sale
    in australia pg porn porn ad finder sex therapist
    indiana pa how old do you have to be to have sex sex coupons for her ideas oriental porn sex hotel exploited college girls porn emo sex sex free video
    gay stepdad porn good sex meme instagram how to describe what sex feels
    like for a girl best sex toys sex factor porn hub lesbians my
    free black porn ghost porn lost bet porn hot mature porn sex
    during first trimester safe or not dirty sex talk quotes for him popular porn stars rape porn videos bengali porn transsexual
    transgender meaning bedroom sexuality comedy central
    sex jokes good sex positions to impress your woman hot teen lesbian porn kim and kanye sex tape sex
    signs cancer woman young porn tubes new sex toys fire snake sexuality
    bhabhi sex sex friends having sex vegas second shooting justin bieber
    gay porn wife cheating porn sex with wife and her friend gay uncle
    porn cute girls porn anal sex porn tumblr sex blogs good sexting lines for
    him sex toy storage

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

    Hi there, after reading this awesome paragraph i am as well cheerful to share my knowledge here with colleagues.

  23. 2018年6月13日20:14 | #23

    Incredible quest there. What happened after? Good luck!

  24. 2018年6月13日20:16 | #24

    Admiring the persistence you put into your site and detailed information you offer.
    It’s good to come across a blog every once in a while that isn’t
    the same old rehashed material. Fantastic read! I’ve saved your site and I’m
    adding your RSS feeds to my Google account.

  25. 2018年6月13日20:26 | #25

    Ⲩour method of telling everything in tһiѕ piеce
    of writing is in fact fastidious, every one be able to simply be
    aware of it, Thanks a lot.

  26. 2018年6月13日20:30 | #26

    The other day, while I was at work, my cousin stole my iphone and tested to see if it can survive a twenty five foot drop, just so she
    can be a youtube sensation. My iPad is now destroyed and she has 83 views.
    I know this is completely off topic but I had to share it with someone!

  27. 2018年6月13日20:31 | #27

    Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my
    blog that automatically tweet my newest twitter updates.

    I’ve been looking for a plug-in like this for quite some time and was
    hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward to your new updates.

  28. 2018年6月13日20:36 | #28

    A person necessarily help to make significantly articles I
    would state. This is the first time I frequented your web page and
    to this point? I amazed with the research you made to
    create this actual submit amazing. Fantastic
    activity!

  29. 2018年6月13日20:38 | #29

    A civilização começou com a agricultura, nossos
    ancestrais nômades se estabeleceram quando começaram a
    cultivar sua própria comida. Agricultura refere-se à produção de bens através
    do cultivo de plantas, animais e outras formas de vida em terra.
    Em 2006, 45% da população mundial trabalhava na agricultura.
    No entanto, a importância relativa da agricultura caiu desde o início da industrialização.
    Embora a agricultura empregue um terço da população mundial, a produção agrícola representa menos
    de 5% do produto mundial bruto.

    A agricultura é importante não só para o fornecimento de alimentos, mas também para o
    fornecimento de matérias-primas para outras indústrias, como
    têxteis, açúcar, juta, óleo vegetal e tabaco. Além de ser uma ocupação para as pessoas,
    a agricultura também é um modo de vida. A maioria dos costumes e cultura do mundo gira em torno da
    agricultura. Uma série de festivais e feriados
    ao redor do mundo estão em conjunção com a colheita ou colheita ou qualquer outro aspecto da agricultura.
    Aumenta a oferta de alimentos e receitas fiscais ao governo.
    “Surplus Investable” é gerado, que pode
    ser expandido para outras indústrias e fornece
    divisas.

    Devido à aparente abundância de alimentos devido às tecnologias de crescimento, transporte e armazenamento; a humanidade
    moderna ignorou a dependência fundamental da agricultura.
    A agricultura fornece nutrição, que é um determinante chave da saúde; alivia a pobreza e
    a subsistência individual. Alguns outros benefícios são:
    o Água – as culturas agrícolas são os maiores usuários de água
    doce. As florestas mantêm o lençol freático de que dispomos para nossos usos cotidianos.

    A criação de animais afeta a saúde das águas costeiras.

    o Energia – a madeira é uma importante fonte de combustível e energia.
    As usinas modernas de biomassa estão crescendo rapidamente na maioria dos países.
    Estes fornecem energia limpa e também ajudam no
    crescimento econômico.
    o Saúde – a agricultura fornece nutrição aos humanos.
    Não podemos viver de carne, leite e aves por mais de 2 dias sem consumir
    grãos, legumes ou frutas. Imagine o que a falta de agricultura poderia fazer para nós.

    o Biodiversidade – os equilíbrios ecológicos são
    mantidos, alterados ou destruídos apenas pela agricultura.
    Estes são críticos para sustentar o desenvolvimento e a saúde do nosso planeta.

    Mudanças climáticas – redução do crescimento agrícola afeta negativamente o clima.

    Eventos extremos e disfunções ecológicas afetarão o nosso planeta e a raça humana.

    É um ciclo vicioso em que a degradação ambiental está
    afetando a produtividade agrícola e as práticas agrícolas estão afetando o
    meio ambiente. Para concluir a agricultura, a ciência e a
    tecnologia agrícola ajudam a reduzir a fome,
    melhorando a subsistência e aumentando o crescimento econômico.

    Práticas agrícolas locais e indígenas precisam ser usadas
    junto com pesquisas e desenvolvimentos científicos. Deveria
    haver uma coordenação de programas científicos internacionais para melhorar
    a agricultura e a produção agrícola. Políticas e tecnologias que favorecem o uso sustentável dos recursos naturais devem ser compartilhadas internacionalmente.
    É imperativo aliviar a fome e buscar as causas da insegurança nutricional e dos recursos naturais degradados.
    A produtividade das lavouras, da pecuária e da pesca precisa aumentar de
    maneira social e ambientalmente sustentável, o que é
    aceitável tanto para os agricultores quanto para
    os consumidores. A agricultura é um aspecto importante de todas as sociedades para o seu crescimento social, econômico e ambiental.

  30. 2018年6月13日20:43 | #30

    This blog was… how do I say it? Relevant!! Finally I
    have found something that helped me. Thank you!

  31. 2018年6月13日20:46 | #31

    Saved as a favorite, I like your site!

  32. 2018年6月13日20:51 | #32

    I go to see every day a few sites and information sites
    to read content, however this weblog gives quality based content.

  33. 2018年6月13日20:59 | #33

    Visit this excellent wegsite for mmore information on some
    excellent Skyy Plus Offers. You can go too visit to get a DVD Creaator to make your photos right into a DVD.

    In this Shahrukh Khan has played role just as the one
    played in Super Hero.

  34. 2018年6月13日21:07 | #34

    I’m amazed, I have to admit. Seldom do I encounter a blog that’s both educative
    and entertaining, and let me tell you, you’ve hit the nail
    on the head. The problem is something which not enough men and women are speaking intelligently about.
    I’m very happy that I found this during my search for something regarding this.

  35. 2018年6月13日21:22 | #35

    Outstanding ppost bᥙt Ӏ wɑs wondering if yoᥙ
    could wriye a litte moгe on thiѕ topic? I’d be veгy thankful if уoս ϲould elaborate
    a lіttle bit more. Cheers!

  36. 2018年6月13日21:22 | #36

    play casino games online
    casinos online
    casino online subtitrat
    online casino

  37. 2018年6月13日21:24 | #37

    Some truly fantastic posts on this website, regards for contribution.

  38. 2018年6月13日21:32 | #38

    Тhat is гeally fascinating, Yοu’re an excessively professional blogger.
    I’ve joined your rss feed and stay up for seeking more of your excellent pοst.
    Also, I have shared your website in my social networks

  39. 2018年6月13日21:35 | #39

    Hello to every body, it’s my first pay a visit of this
    website; this webpage consists of amazing and really good data designed for visitors.

  40. 2018年6月13日21:43 | #40

    If anyone knows denim, it is Topѕhop.

  41. 2018年6月13日21:45 | #41

    Great blog here! Also your website loads up very fast!
    What host are you using? Can I get your affiliate link to your host?
    I wish my web site loaded up as quickly as yours lol

  42. 2018年6月13日21:54 | #42

    Online Canadian Pharmacies
    canadian pharmacies online
    cvs pharmacy online

  43. 2018年6月13日21:59 | #43

    It’s an awesome article in favor of all the online viewers; they will get benefit from it I am sure.

  44. 2018年6月13日22:03 | #44

    This is my first time pay a visit at here and i am actually happy to read everthing at single place.

  45. 2018年6月13日22:04 | #45

    WOW just what I was looking for. Came here by searching for sale 2bhk apartments in coimbatore

  46. 2018年6月13日22:11 | #46

    Hi, Neat рoѕt. Theгe is ann issue with your web site in internet exⲣlorer, could check this…
    IE nonetheless is the markest leader and a big
    portion of people will miss your еxcellent writing becaᥙse of
    this problem.

  47. 2018年6月13日22:11 | #47

    casino games
    online casino slots
    casinos online
    online casino
    online casino gambling

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

    Thank you a bunch for sharing this with all of us you
    really realize what you are speaking about!
    Bookmarked. Kindly also discuss with my web site =). We may have a hyperlink trade agreement between us

  49. 2018年6月13日22:19 | #49

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

  50. 2018年6月13日22:27 | #50

    Thanks for your personal marvelous posting! I seriously enjoyed reading it, you are a great author.
    I will ensure that I bookmark your blog and will eventually come back at some point.
    I want to encourage you to ultimately continue your great writing, have a nice
    holiday weekend!

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