Mininet CLI连接主机时xterm无法显示的问题求助
问题:Mininet CLI中执行xterm无法弹出Xming窗口
已下载并启动Mininet VM,通过PuTTY的SSH连接至该虚拟机,会话中已启用X11转发,X显示位置设置为localhost:0。创建了名为lineartopology.py的自定义拓扑,代码如下:
#!/usr/bin/python from mininet.topo import Topo from mininet.net import Mininet from mininet.node import CPULimitedHost from mininet.link import TCLink from mininet.util import irange, dumpNodeConnections from mininet.log import setLogLevel from mininet.cli import CLI class LinearTopo(Topo): "Linear topology of n switches, with one host per switch." def __init__(self, n=2, **opts): """Init. n: number of switches (and hosts) hconf: host configuration options lconf: link configuration options""" super(LinearTopo, self).__init__(**opts) self.n = n # Adding the switches and hosts for i in range(1, n+1): switch = self.addSwitch(f's{i}') host = self.addHost(f'h{i}') self.addLink(host, switch) if i > 1: self.addLink(f's{i-1}', switch) def simpleTest(): "Create and test a simple network" topo = LinearTopo(n=4) net = Mininet(topo) net.start() print("Dumping host connections") dumpNodeConnections(net.hosts) print("Testing network connectivity") net.pingAll() CLI(net) net.stop() if __name__ == '__main__': setLogLevel('info') simpleTest()
进入Mininet CLI前,执行xterm命令可正常弹出Xming窗口(使用的X Server为Xming,显示编号设为0)。但执行sudo python lineartopology.py创建拓扑并进入CLI后,执行xterm h1 h4等命令时,Xming窗口不再弹出。已在CLI外执行export DISPLAY=localhost:0,还尝试了以下解决步骤:
- 执行
sudo apt-get install xterm,提示xterm已是最新版本; - 在
.bashrc文件中添加DISPLAY=localhost:0配置; - 执行
sudo mn -x; - 执行
sudo -E mn; - 执行
sudo apt-get install xorg; - 执行
xauth list $DISPLAY,无输出。
已耗时一天排查,上述操作均无效,仍无法在拓扑主机中调出Xming显示窗口,寻求技术帮助。
内容的提问来源于stack exchange,提问作者Student
相关产品推荐
相关产品推荐

